From 00efb88ac7579996529516a3ba1aa86d3a7b36e7 Mon Sep 17 00:00:00 2001 From: pbattu Date: Tue, 21 May 2019 18:42:14 -0300 Subject: [PATCH] fc changes to support ubuntu-18.04 upgrade --- .gitignore | 0 .gitmodules | 0 CMakeLists.txt | 15 +- CMakeModules/ArgumentParser.cmake | 0 CMakeModules/FindBoost.cmake | 0 CMakeModules/FindReadline.cmake | 2 - CMakeModules/FindVLD.cmake | 0 CMakeModules/ParseLibraryList.cmake | 0 CMakeModules/SetupTargetMacros.cmake | 0 CMakeModules/UseLibraryMacros.cmake | 0 CMakeModules/VersionMacros.cmake | 0 GitVersionGen/GetGitRevisionDescription.cmake | 0 .../GetGitRevisionDescription.cmake.in | 0 README-ecc.md | 0 README.md | 0 fc.natvis | 0 include/fc/actor.hpp | 0 include/fc/aligned.hpp | 0 include/fc/any.hpp | 0 include/fc/api.hpp | 0 include/fc/array.hpp | 0 include/fc/asio.hpp | 0 include/fc/bitutil.hpp | 0 include/fc/bloom_filter.hpp | 0 include/fc/compress/smaz.hpp | 0 include/fc/compress/zlib.hpp | 0 include/fc/container/deque.hpp | 0 include/fc/container/deque_fwd.hpp | 0 include/fc/container/flat.hpp | 0 include/fc/container/flat_fwd.hpp | 0 include/fc/crypto/aes.hpp | 0 include/fc/crypto/base36.hpp | 0 include/fc/crypto/base58.hpp | 0 include/fc/crypto/base64.hpp | 0 include/fc/crypto/bigint.hpp | 0 include/fc/crypto/blowfish.hpp | 0 include/fc/crypto/city.hpp | 0 include/fc/crypto/dh.hpp | 0 include/fc/crypto/digest.hpp | 0 include/fc/crypto/elliptic.hpp | 26 +- include/fc/crypto/hash_ctr_rng.hpp | 0 include/fc/crypto/hex.hpp | 0 include/fc/crypto/hmac.hpp | 0 include/fc/crypto/md5.hpp | 0 include/fc/crypto/openssl.hpp | 0 include/fc/crypto/pke.hpp | 0 include/fc/crypto/rand.hpp | 0 include/fc/crypto/ripemd160.hpp | 0 include/fc/crypto/sha1.hpp | 0 include/fc/crypto/sha224.hpp | 0 include/fc/crypto/sha256.hpp | 12 +- include/fc/crypto/sha512.hpp | 0 include/fc/exception/exception.hpp | 0 include/fc/filesystem.hpp | 0 include/fc/fixed_string.hpp | 0 include/fc/fwd.hpp | 0 include/fc/fwd_impl.hpp | 0 include/fc/git_revision.hpp | 0 include/fc/interprocess/container.hpp | 0 include/fc/interprocess/file_mapping.hpp | 0 include/fc/interprocess/file_mutex.hpp | 0 include/fc/interprocess/iprocess.hpp | 0 include/fc/interprocess/mmap_struct.hpp | 0 include/fc/interprocess/process.hpp | 0 include/fc/interprocess/signals.hpp | 0 include/fc/io/buffered_iostream.hpp | 0 include/fc/io/console.hpp | 0 include/fc/io/datastream.hpp | 0 include/fc/io/datastream_back.hpp | 0 include/fc/io/enum_type.hpp | 0 include/fc/io/fstream.hpp | 0 include/fc/io/iobuffer.hpp | 0 include/fc/io/iostream.hpp | 0 include/fc/io/json.hpp | 0 include/fc/io/json_relaxed.hpp | 0 include/fc/io/raw.hpp | 0 include/fc/io/raw_fwd.hpp | 0 include/fc/io/raw_unpack_file.hpp | 0 include/fc/io/raw_variant.hpp | 0 include/fc/io/sstream.hpp | 0 include/fc/io/stdio.hpp | 0 include/fc/io/varint.hpp | 0 include/fc/log/appender.hpp | 0 include/fc/log/console_appender.hpp | 0 include/fc/log/file_appender.hpp | 0 include/fc/log/gelf_appender.hpp | 0 include/fc/log/log_message.hpp | 0 include/fc/log/logger.hpp | 0 include/fc/log/logger_config.hpp | 0 include/fc/make_fused.hpp | 0 include/fc/network/http/connection.hpp | 0 include/fc/network/http/server.hpp | 0 include/fc/network/http/websocket.hpp | 0 include/fc/network/ip.hpp | 0 include/fc/network/ntp.hpp | 0 include/fc/network/rate_limiting.hpp | 0 include/fc/network/resolve.hpp | 0 include/fc/network/tcp_socket.hpp | 0 include/fc/network/tcp_socket_io_hooks.hpp | 0 include/fc/network/udp_socket.hpp | 0 include/fc/network/url.hpp | 0 include/fc/noncopyable.hpp | 0 include/fc/optional.hpp | 0 include/fc/platform_independence.hpp | 0 include/fc/real128.hpp | 0 include/fc/reflect/reflect.hpp | 0 include/fc/reflect/typename.hpp | 2 +- include/fc/reflect/variant.hpp | 0 include/fc/rpc/api_connection.hpp | 0 include/fc/rpc/binary_api_connection.hpp | 0 include/fc/rpc/bstate.hpp | 0 include/fc/rpc/cli.hpp | 0 include/fc/rpc/http_api.hpp | 0 include/fc/rpc/json_connection.hpp | 0 include/fc/rpc/state.hpp | 0 include/fc/rpc/variant_connection.hpp | 0 include/fc/rpc/variant_stream.hpp | 0 include/fc/rpc/websocket_api.hpp | 0 include/fc/safe.hpp | 0 include/fc/scoped_exit.hpp | 0 include/fc/shared_ptr.hpp | 0 include/fc/signal.hpp | 0 include/fc/signals.hpp | 0 include/fc/smart_ref_fwd.hpp | 0 include/fc/smart_ref_impl.hpp | 0 include/fc/static_variant.hpp | 2 +- include/fc/string.hpp | 0 include/fc/thread/future.hpp | 0 include/fc/thread/mutex.hpp | 0 .../fc/thread/non_preemptable_scope_check.hpp | 0 include/fc/thread/priority.hpp | 0 include/fc/thread/scoped_lock.hpp | 0 include/fc/thread/spin_lock.hpp | 0 include/fc/thread/spin_yield_lock.hpp | 0 include/fc/thread/task.hpp | 0 include/fc/thread/thread.hpp | 0 include/fc/thread/thread_specific.hpp | 0 include/fc/thread/unique_lock.hpp | 0 include/fc/thread/wait_condition.hpp | 0 include/fc/time.hpp | 0 include/fc/tuple.hpp | 0 include/fc/uint128.hpp | 0 include/fc/unique_ptr.hpp | 0 include/fc/utf8.hpp | 0 include/fc/utility.hpp | 0 include/fc/variant.hpp | 0 include/fc/variant_object.hpp | 0 include/fc/vector.hpp | 0 include/fc/vector_fwd.hpp | 0 include/fc/wait_any.hpp | 0 src/asio.cpp | 0 src/byteswap.hpp | 0 src/compress/miniz.c | 0 src/compress/smaz.cpp | 0 src/compress/zlib.cpp | 0 src/crypto/_digest_common.cpp | 0 src/crypto/_digest_common.hpp | 0 src/crypto/_elliptic_impl_priv.hpp | 0 src/crypto/_elliptic_impl_pub.hpp | 0 src/crypto/aes.cpp | 0 src/crypto/base36.cpp | 0 src/crypto/base58.cpp | 143 +++--- src/crypto/base64.cpp | 0 src/crypto/bigint.cpp | 0 src/crypto/blowfish.cpp | 0 src/crypto/city.cpp | 0 src/crypto/crc.cpp | 0 src/crypto/dh.cpp | 44 +- src/crypto/elliptic_common.cpp | 13 +- src/crypto/elliptic_impl_priv.cpp | 0 src/crypto/elliptic_impl_pub.cpp | 0 src/crypto/elliptic_mixed.cpp | 0 src/crypto/elliptic_openssl.cpp | 0 src/crypto/elliptic_secp256k1.cpp | 254 ---------- src/crypto/hex.cpp | 0 src/crypto/md5.cpp | 0 src/crypto/openssl.cpp | 0 src/crypto/pke.cpp | 0 src/crypto/rand.cpp | 0 src/crypto/ripemd160.cpp | 0 src/crypto/sha1.cpp | 0 src/crypto/sha224.cpp | 0 src/crypto/sha256.cpp | 0 src/crypto/sha512.cpp | 0 src/exception.cpp | 0 src/filesystem.cpp | 27 +- src/git_revision.cpp.in | 0 src/interprocess/file_mapping.cpp | 0 src/interprocess/file_mutex.cpp | 0 src/interprocess/mmap_struct.cpp | 0 src/interprocess/process.cpp | 0 src/interprocess/signals.cpp | 0 src/io/buffered_iostream.cpp | 0 src/io/console.cpp | 0 src/io/datastream.cpp | 0 src/io/fstream.cpp | 0 src/io/iostream.cpp | 0 src/io/json.cpp | 0 src/io/sstream.cpp | 0 src/io/varint.cpp | 0 src/log/appender.cpp | 0 src/log/console_appender.cpp | 0 src/log/console_defines.h | 0 src/log/file_appender.cpp | 1 + src/log/gelf_appender.cpp | 0 src/log/log_message.cpp | 0 src/log/logger.cpp | 0 src/log/logger_config.cpp | 0 src/network/http/http_connection.cpp | 0 src/network/http/http_server.cpp | 0 src/network/http/websocket.cpp | 0 src/network/ip.cpp | 0 src/network/ntp.cpp | 0 src/network/rate_limiting.cpp | 0 src/network/resolve.cpp | 0 src/network/tcp_socket.cpp | 10 +- src/network/udp_socket.cpp | 0 src/network/url.cpp | 0 src/real128.cpp | 0 src/rpc/bstate.cpp | 0 src/rpc/cli.cpp | 0 src/rpc/http_api.cpp | 0 src/rpc/json_connection.cpp | 0 src/rpc/state.cpp | 0 src/rpc/websocket_api.cpp | 0 src/shared_ptr.cpp | 0 src/string.cpp | 0 src/thread/context.hpp | 17 +- src/thread/future.cpp | 0 src/thread/mutex.cpp | 0 src/thread/non_preemptable_scope_check.cpp | 0 src/thread/spin_lock.cpp | 0 src/thread/spin_yield_lock.cpp | 0 src/thread/task.cpp | 0 src/thread/thread.cpp | 0 src/thread/thread_d.hpp | 21 +- src/thread/thread_specific.cpp | 0 src/time.cpp | 0 src/uint128.cpp | 0 src/utf8.cpp | 0 src/utf8/ReleaseNotes | 0 src/utf8/checked.h | 0 src/utf8/core.h | 0 src/utf8/unchecked.h | 0 src/utf8/utf8cpp.html | 0 src/variant.cpp | 0 src/variant_object.cpp | 0 tests/CMakeLists.txt | 4 +- tests/all_tests.cpp | 0 tests/api.cpp | 0 tests/bip_lock.cpp | 0 tests/blinding_test.cpp | 3 +- tests/bloom_test.cpp | 0 tests/compress/compress.cpp | 0 tests/crypto/aes_test.cpp | 0 tests/crypto/base_n_tests.cpp | 0 tests/crypto/bigint_test.cpp | 0 tests/crypto/blind.cpp | 0 tests/crypto/blowfish_test.cpp | 0 tests/crypto/dh_test.cpp | 0 tests/crypto/ecc_test.cpp | 0 tests/crypto/log_test.cpp | 0 tests/crypto/rand_test.cpp | 0 tests/crypto/sha_tests.cpp | 0 tests/hmac_test.cpp | 0 tests/network/http/websocket_test.cpp | 0 tests/rate_limiting.cpp | 0 tests/real128_test.cpp | 0 tests/rpc.cpp | 0 tests/sleep.cpp | 0 tests/thread/task_cancel.cpp | 0 tests/thread/thread_tests.cpp | 95 ++++ tests/utf8_test.cpp | 0 vendor/boost_1.51/include/boost/process.hpp | 25 - .../boost_1.51/include/boost/process/all.hpp | 40 -- .../include/boost/process/child.hpp | 100 ---- .../include/boost/process/config.hpp | 74 --- .../include/boost/process/context.hpp | 139 ------ .../boost/process/detail/basic_status.hpp | 69 --- .../process/detail/basic_status_service.hpp | 323 ------------- .../boost/process/detail/posix_helpers.hpp | 106 ----- .../boost/process/detail/status_impl.hpp | 190 -------- .../boost/process/detail/systembuf.hpp | 228 --------- .../boost/process/detail/windows_helpers.hpp | 138 ------ .../include/boost/process/environment.hpp | 52 --- .../include/boost/process/handle.hpp | 231 --------- .../include/boost/process/operations.hpp | 439 ------------------ .../include/boost/process/pid_type.hpp | 56 --- .../boost_1.51/include/boost/process/pipe.hpp | 49 -- .../include/boost/process/pistream.hpp | 114 ----- .../include/boost/process/postream.hpp | 115 ----- .../include/boost/process/process.hpp | 213 --------- .../boost_1.51/include/boost/process/self.hpp | 188 -------- .../include/boost/process/status.hpp | 41 -- .../include/boost/process/stream_behavior.hpp | 326 ------------- .../include/boost/process/stream_ends.hpp | 68 --- .../include/boost/process/stream_id.hpp | 50 -- .../include/boost/process/stream_type.hpp | 45 -- .../context/asm/fcontext_arm_aapcs_elf_gas.S | 101 ---- .../context/asm/fcontext_i386_ms_pe_masm.asm | 151 ------ .../context/asm/fcontext_i386_sysv_elf_gas.S | 122 ----- .../asm/fcontext_i386_sysv_macho_gas.S | 118 ----- .../context/asm/fcontext_mips32_o32_elf_gas.S | 144 ------ .../context/asm/fcontext_ppc32_sysv_elf_gas.S | 222 --------- .../context/asm/fcontext_ppc64_sysv_elf_gas.S | 250 ---------- .../asm/fcontext_x86_64_ms_pe_masm.asm | 207 --------- .../asm/fcontext_x86_64_sysv_elf_gas.S | 116 ----- .../asm/fcontext_x86_64_sysv_macho_gas.S | 111 ----- vendor/boost_1.51/libs/context/fcontext.cpp | 36 -- vendor/boost_1.51/libs/context/seh.cpp | 83 ---- .../libs/context/stack_allocator_posix.cpp | 85 ---- .../libs/context/stack_allocator_windows.cpp | 86 ---- .../libs/context/stack_utils_posix.cpp | 81 ---- .../libs/context/stack_utils_windows.cpp | 84 ---- vendor/diff-match-patch-cpp-stl | 1 - 315 files changed, 282 insertions(+), 5826 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 .gitmodules mode change 100644 => 100755 CMakeLists.txt mode change 100644 => 100755 CMakeModules/ArgumentParser.cmake mode change 100644 => 100755 CMakeModules/FindBoost.cmake mode change 100644 => 100755 CMakeModules/FindReadline.cmake mode change 100644 => 100755 CMakeModules/FindVLD.cmake mode change 100644 => 100755 CMakeModules/ParseLibraryList.cmake mode change 100644 => 100755 CMakeModules/SetupTargetMacros.cmake mode change 100644 => 100755 CMakeModules/UseLibraryMacros.cmake mode change 100644 => 100755 CMakeModules/VersionMacros.cmake mode change 100644 => 100755 GitVersionGen/GetGitRevisionDescription.cmake mode change 100644 => 100755 GitVersionGen/GetGitRevisionDescription.cmake.in mode change 100644 => 100755 README-ecc.md mode change 100644 => 100755 README.md mode change 100644 => 100755 fc.natvis mode change 100644 => 100755 include/fc/actor.hpp mode change 100644 => 100755 include/fc/aligned.hpp mode change 100644 => 100755 include/fc/any.hpp mode change 100644 => 100755 include/fc/api.hpp mode change 100644 => 100755 include/fc/array.hpp mode change 100644 => 100755 include/fc/asio.hpp mode change 100644 => 100755 include/fc/bitutil.hpp mode change 100644 => 100755 include/fc/bloom_filter.hpp mode change 100644 => 100755 include/fc/compress/smaz.hpp mode change 100644 => 100755 include/fc/compress/zlib.hpp mode change 100644 => 100755 include/fc/container/deque.hpp mode change 100644 => 100755 include/fc/container/deque_fwd.hpp mode change 100644 => 100755 include/fc/container/flat.hpp mode change 100644 => 100755 include/fc/container/flat_fwd.hpp mode change 100644 => 100755 include/fc/crypto/aes.hpp mode change 100644 => 100755 include/fc/crypto/base36.hpp mode change 100644 => 100755 include/fc/crypto/base58.hpp mode change 100644 => 100755 include/fc/crypto/base64.hpp mode change 100644 => 100755 include/fc/crypto/bigint.hpp mode change 100644 => 100755 include/fc/crypto/blowfish.hpp mode change 100644 => 100755 include/fc/crypto/city.hpp mode change 100644 => 100755 include/fc/crypto/dh.hpp mode change 100644 => 100755 include/fc/crypto/digest.hpp mode change 100644 => 100755 include/fc/crypto/elliptic.hpp mode change 100644 => 100755 include/fc/crypto/hash_ctr_rng.hpp mode change 100644 => 100755 include/fc/crypto/hex.hpp mode change 100644 => 100755 include/fc/crypto/hmac.hpp mode change 100644 => 100755 include/fc/crypto/md5.hpp mode change 100644 => 100755 include/fc/crypto/openssl.hpp mode change 100644 => 100755 include/fc/crypto/pke.hpp mode change 100644 => 100755 include/fc/crypto/rand.hpp mode change 100644 => 100755 include/fc/crypto/ripemd160.hpp mode change 100644 => 100755 include/fc/crypto/sha1.hpp mode change 100644 => 100755 include/fc/crypto/sha224.hpp mode change 100644 => 100755 include/fc/crypto/sha256.hpp mode change 100644 => 100755 include/fc/crypto/sha512.hpp mode change 100644 => 100755 include/fc/exception/exception.hpp mode change 100644 => 100755 include/fc/filesystem.hpp mode change 100644 => 100755 include/fc/fixed_string.hpp mode change 100644 => 100755 include/fc/fwd.hpp mode change 100644 => 100755 include/fc/fwd_impl.hpp mode change 100644 => 100755 include/fc/git_revision.hpp mode change 100644 => 100755 include/fc/interprocess/container.hpp mode change 100644 => 100755 include/fc/interprocess/file_mapping.hpp mode change 100644 => 100755 include/fc/interprocess/file_mutex.hpp mode change 100644 => 100755 include/fc/interprocess/iprocess.hpp mode change 100644 => 100755 include/fc/interprocess/mmap_struct.hpp mode change 100644 => 100755 include/fc/interprocess/process.hpp mode change 100644 => 100755 include/fc/interprocess/signals.hpp mode change 100644 => 100755 include/fc/io/buffered_iostream.hpp mode change 100644 => 100755 include/fc/io/console.hpp mode change 100644 => 100755 include/fc/io/datastream.hpp mode change 100644 => 100755 include/fc/io/datastream_back.hpp mode change 100644 => 100755 include/fc/io/enum_type.hpp mode change 100644 => 100755 include/fc/io/fstream.hpp mode change 100644 => 100755 include/fc/io/iobuffer.hpp mode change 100644 => 100755 include/fc/io/iostream.hpp mode change 100644 => 100755 include/fc/io/json.hpp mode change 100644 => 100755 include/fc/io/json_relaxed.hpp mode change 100644 => 100755 include/fc/io/raw.hpp mode change 100644 => 100755 include/fc/io/raw_fwd.hpp mode change 100644 => 100755 include/fc/io/raw_unpack_file.hpp mode change 100644 => 100755 include/fc/io/raw_variant.hpp mode change 100644 => 100755 include/fc/io/sstream.hpp mode change 100644 => 100755 include/fc/io/stdio.hpp mode change 100644 => 100755 include/fc/io/varint.hpp mode change 100644 => 100755 include/fc/log/appender.hpp mode change 100644 => 100755 include/fc/log/console_appender.hpp mode change 100644 => 100755 include/fc/log/file_appender.hpp mode change 100644 => 100755 include/fc/log/gelf_appender.hpp mode change 100644 => 100755 include/fc/log/log_message.hpp mode change 100644 => 100755 include/fc/log/logger.hpp mode change 100644 => 100755 include/fc/log/logger_config.hpp mode change 100644 => 100755 include/fc/make_fused.hpp mode change 100644 => 100755 include/fc/network/http/connection.hpp mode change 100644 => 100755 include/fc/network/http/server.hpp mode change 100644 => 100755 include/fc/network/http/websocket.hpp mode change 100644 => 100755 include/fc/network/ip.hpp mode change 100644 => 100755 include/fc/network/ntp.hpp mode change 100644 => 100755 include/fc/network/rate_limiting.hpp mode change 100644 => 100755 include/fc/network/resolve.hpp mode change 100644 => 100755 include/fc/network/tcp_socket.hpp mode change 100644 => 100755 include/fc/network/tcp_socket_io_hooks.hpp mode change 100644 => 100755 include/fc/network/udp_socket.hpp mode change 100644 => 100755 include/fc/network/url.hpp mode change 100644 => 100755 include/fc/noncopyable.hpp mode change 100644 => 100755 include/fc/optional.hpp mode change 100644 => 100755 include/fc/platform_independence.hpp mode change 100644 => 100755 include/fc/real128.hpp mode change 100644 => 100755 include/fc/reflect/reflect.hpp mode change 100644 => 100755 include/fc/reflect/typename.hpp mode change 100644 => 100755 include/fc/reflect/variant.hpp mode change 100644 => 100755 include/fc/rpc/api_connection.hpp mode change 100644 => 100755 include/fc/rpc/binary_api_connection.hpp mode change 100644 => 100755 include/fc/rpc/bstate.hpp mode change 100644 => 100755 include/fc/rpc/cli.hpp mode change 100644 => 100755 include/fc/rpc/http_api.hpp mode change 100644 => 100755 include/fc/rpc/json_connection.hpp mode change 100644 => 100755 include/fc/rpc/state.hpp mode change 100644 => 100755 include/fc/rpc/variant_connection.hpp mode change 100644 => 100755 include/fc/rpc/variant_stream.hpp mode change 100644 => 100755 include/fc/rpc/websocket_api.hpp mode change 100644 => 100755 include/fc/safe.hpp mode change 100644 => 100755 include/fc/scoped_exit.hpp mode change 100644 => 100755 include/fc/shared_ptr.hpp mode change 100644 => 100755 include/fc/signal.hpp mode change 100644 => 100755 include/fc/signals.hpp mode change 100644 => 100755 include/fc/smart_ref_fwd.hpp mode change 100644 => 100755 include/fc/smart_ref_impl.hpp mode change 100644 => 100755 include/fc/static_variant.hpp mode change 100644 => 100755 include/fc/string.hpp mode change 100644 => 100755 include/fc/thread/future.hpp mode change 100644 => 100755 include/fc/thread/mutex.hpp mode change 100644 => 100755 include/fc/thread/non_preemptable_scope_check.hpp mode change 100644 => 100755 include/fc/thread/priority.hpp mode change 100644 => 100755 include/fc/thread/scoped_lock.hpp mode change 100644 => 100755 include/fc/thread/spin_lock.hpp mode change 100644 => 100755 include/fc/thread/spin_yield_lock.hpp mode change 100644 => 100755 include/fc/thread/task.hpp mode change 100644 => 100755 include/fc/thread/thread.hpp mode change 100644 => 100755 include/fc/thread/thread_specific.hpp mode change 100644 => 100755 include/fc/thread/unique_lock.hpp mode change 100644 => 100755 include/fc/thread/wait_condition.hpp mode change 100644 => 100755 include/fc/time.hpp mode change 100644 => 100755 include/fc/tuple.hpp mode change 100644 => 100755 include/fc/uint128.hpp mode change 100644 => 100755 include/fc/unique_ptr.hpp mode change 100644 => 100755 include/fc/utf8.hpp mode change 100644 => 100755 include/fc/utility.hpp mode change 100644 => 100755 include/fc/variant.hpp mode change 100644 => 100755 include/fc/variant_object.hpp mode change 100644 => 100755 include/fc/vector.hpp mode change 100644 => 100755 include/fc/vector_fwd.hpp mode change 100644 => 100755 include/fc/wait_any.hpp mode change 100644 => 100755 src/asio.cpp mode change 100644 => 100755 src/byteswap.hpp mode change 100644 => 100755 src/compress/miniz.c mode change 100644 => 100755 src/compress/smaz.cpp mode change 100644 => 100755 src/compress/zlib.cpp mode change 100644 => 100755 src/crypto/_digest_common.cpp mode change 100644 => 100755 src/crypto/_digest_common.hpp mode change 100644 => 100755 src/crypto/_elliptic_impl_priv.hpp mode change 100644 => 100755 src/crypto/_elliptic_impl_pub.hpp mode change 100644 => 100755 src/crypto/aes.cpp mode change 100644 => 100755 src/crypto/base36.cpp mode change 100644 => 100755 src/crypto/base58.cpp mode change 100644 => 100755 src/crypto/base64.cpp mode change 100644 => 100755 src/crypto/bigint.cpp mode change 100644 => 100755 src/crypto/blowfish.cpp mode change 100644 => 100755 src/crypto/city.cpp mode change 100644 => 100755 src/crypto/crc.cpp mode change 100644 => 100755 src/crypto/dh.cpp mode change 100644 => 100755 src/crypto/elliptic_common.cpp mode change 100644 => 100755 src/crypto/elliptic_impl_priv.cpp mode change 100644 => 100755 src/crypto/elliptic_impl_pub.cpp mode change 100644 => 100755 src/crypto/elliptic_mixed.cpp mode change 100644 => 100755 src/crypto/elliptic_openssl.cpp mode change 100644 => 100755 src/crypto/elliptic_secp256k1.cpp mode change 100644 => 100755 src/crypto/hex.cpp mode change 100644 => 100755 src/crypto/md5.cpp mode change 100644 => 100755 src/crypto/openssl.cpp mode change 100644 => 100755 src/crypto/pke.cpp mode change 100644 => 100755 src/crypto/rand.cpp mode change 100644 => 100755 src/crypto/ripemd160.cpp mode change 100644 => 100755 src/crypto/sha1.cpp mode change 100644 => 100755 src/crypto/sha224.cpp mode change 100644 => 100755 src/crypto/sha256.cpp mode change 100644 => 100755 src/crypto/sha512.cpp mode change 100644 => 100755 src/exception.cpp mode change 100644 => 100755 src/filesystem.cpp mode change 100644 => 100755 src/git_revision.cpp.in mode change 100644 => 100755 src/interprocess/file_mapping.cpp mode change 100644 => 100755 src/interprocess/file_mutex.cpp mode change 100644 => 100755 src/interprocess/mmap_struct.cpp mode change 100644 => 100755 src/interprocess/process.cpp mode change 100644 => 100755 src/interprocess/signals.cpp mode change 100644 => 100755 src/io/buffered_iostream.cpp mode change 100644 => 100755 src/io/console.cpp mode change 100644 => 100755 src/io/datastream.cpp mode change 100644 => 100755 src/io/fstream.cpp mode change 100644 => 100755 src/io/iostream.cpp mode change 100644 => 100755 src/io/json.cpp mode change 100644 => 100755 src/io/sstream.cpp mode change 100644 => 100755 src/io/varint.cpp mode change 100644 => 100755 src/log/appender.cpp mode change 100644 => 100755 src/log/console_appender.cpp mode change 100644 => 100755 src/log/console_defines.h mode change 100644 => 100755 src/log/file_appender.cpp mode change 100644 => 100755 src/log/gelf_appender.cpp mode change 100644 => 100755 src/log/log_message.cpp mode change 100644 => 100755 src/log/logger.cpp mode change 100644 => 100755 src/log/logger_config.cpp mode change 100644 => 100755 src/network/http/http_connection.cpp mode change 100644 => 100755 src/network/http/http_server.cpp mode change 100644 => 100755 src/network/http/websocket.cpp mode change 100644 => 100755 src/network/ip.cpp mode change 100644 => 100755 src/network/ntp.cpp mode change 100644 => 100755 src/network/rate_limiting.cpp mode change 100644 => 100755 src/network/resolve.cpp mode change 100644 => 100755 src/network/tcp_socket.cpp mode change 100644 => 100755 src/network/udp_socket.cpp mode change 100644 => 100755 src/network/url.cpp mode change 100644 => 100755 src/real128.cpp mode change 100644 => 100755 src/rpc/bstate.cpp mode change 100644 => 100755 src/rpc/cli.cpp mode change 100644 => 100755 src/rpc/http_api.cpp mode change 100644 => 100755 src/rpc/json_connection.cpp mode change 100644 => 100755 src/rpc/state.cpp mode change 100644 => 100755 src/rpc/websocket_api.cpp mode change 100644 => 100755 src/shared_ptr.cpp mode change 100644 => 100755 src/string.cpp mode change 100644 => 100755 src/thread/context.hpp mode change 100644 => 100755 src/thread/future.cpp mode change 100644 => 100755 src/thread/mutex.cpp mode change 100644 => 100755 src/thread/non_preemptable_scope_check.cpp mode change 100644 => 100755 src/thread/spin_lock.cpp mode change 100644 => 100755 src/thread/spin_yield_lock.cpp mode change 100644 => 100755 src/thread/task.cpp mode change 100644 => 100755 src/thread/thread.cpp mode change 100644 => 100755 src/thread/thread_d.hpp mode change 100644 => 100755 src/thread/thread_specific.cpp mode change 100644 => 100755 src/time.cpp mode change 100644 => 100755 src/uint128.cpp mode change 100644 => 100755 src/utf8.cpp mode change 100644 => 100755 src/utf8/ReleaseNotes mode change 100644 => 100755 src/utf8/checked.h mode change 100644 => 100755 src/utf8/core.h mode change 100644 => 100755 src/utf8/unchecked.h mode change 100644 => 100755 src/utf8/utf8cpp.html mode change 100644 => 100755 src/variant.cpp mode change 100644 => 100755 src/variant_object.cpp mode change 100644 => 100755 tests/CMakeLists.txt mode change 100644 => 100755 tests/all_tests.cpp mode change 100644 => 100755 tests/api.cpp mode change 100644 => 100755 tests/bip_lock.cpp mode change 100644 => 100755 tests/blinding_test.cpp mode change 100644 => 100755 tests/bloom_test.cpp mode change 100644 => 100755 tests/compress/compress.cpp mode change 100644 => 100755 tests/crypto/aes_test.cpp mode change 100644 => 100755 tests/crypto/base_n_tests.cpp mode change 100644 => 100755 tests/crypto/bigint_test.cpp mode change 100644 => 100755 tests/crypto/blind.cpp mode change 100644 => 100755 tests/crypto/blowfish_test.cpp mode change 100644 => 100755 tests/crypto/dh_test.cpp mode change 100644 => 100755 tests/crypto/ecc_test.cpp mode change 100644 => 100755 tests/crypto/log_test.cpp mode change 100644 => 100755 tests/crypto/rand_test.cpp mode change 100644 => 100755 tests/crypto/sha_tests.cpp mode change 100644 => 100755 tests/hmac_test.cpp mode change 100644 => 100755 tests/network/http/websocket_test.cpp mode change 100644 => 100755 tests/rate_limiting.cpp mode change 100644 => 100755 tests/real128_test.cpp mode change 100644 => 100755 tests/rpc.cpp mode change 100644 => 100755 tests/sleep.cpp mode change 100644 => 100755 tests/thread/task_cancel.cpp create mode 100755 tests/thread/thread_tests.cpp mode change 100644 => 100755 tests/utf8_test.cpp delete mode 100644 vendor/boost_1.51/include/boost/process.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/all.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/child.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/config.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/context.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/detail/basic_status.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/detail/basic_status_service.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/detail/posix_helpers.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/detail/status_impl.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/detail/systembuf.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/detail/windows_helpers.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/environment.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/handle.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/operations.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/pid_type.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/pipe.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/pistream.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/postream.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/process.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/self.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/status.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/stream_behavior.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/stream_ends.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/stream_id.hpp delete mode 100644 vendor/boost_1.51/include/boost/process/stream_type.hpp delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_arm_aapcs_elf_gas.S delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_i386_ms_pe_masm.asm delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_i386_sysv_elf_gas.S delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_i386_sysv_macho_gas.S delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_mips32_o32_elf_gas.S delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_ppc32_sysv_elf_gas.S delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_ppc64_sysv_elf_gas.S delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_x86_64_ms_pe_masm.asm delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_x86_64_sysv_elf_gas.S delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_x86_64_sysv_macho_gas.S delete mode 100644 vendor/boost_1.51/libs/context/fcontext.cpp delete mode 100644 vendor/boost_1.51/libs/context/seh.cpp delete mode 100644 vendor/boost_1.51/libs/context/stack_allocator_posix.cpp delete mode 100644 vendor/boost_1.51/libs/context/stack_allocator_windows.cpp delete mode 100644 vendor/boost_1.51/libs/context/stack_utils_posix.cpp delete mode 100644 vendor/boost_1.51/libs/context/stack_utils_windows.cpp delete mode 160000 vendor/diff-match-patch-cpp-stl diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.gitmodules b/.gitmodules old mode 100644 new mode 100755 diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100644 new mode 100755 index dafcdb0..bd52180 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,7 @@ endif() SET (ORIGINAL_LIB_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) SET(BOOST_COMPONENTS) -LIST(APPEND BOOST_COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context locale iostreams) +LIST(APPEND BOOST_COMPONENTS thread date_time filesystem system program_options signals serialization chrono unit_test_framework context locale iostreams) SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" ) IF( ECC_IMPL STREQUAL openssl ) @@ -190,7 +190,6 @@ set( fc_sources src/io/varint.cpp src/io/console.cpp src/filesystem.cpp - src/interprocess/process.cpp src/interprocess/signals.cpp src/interprocess/file_mapping.cpp src/interprocess/mmap_struct.cpp @@ -336,15 +335,6 @@ else() set( ZLIB_LIBRARIES "" ) endif( ZLIB_FOUND ) -find_package( BZip2 ) -if( BZIP2_FOUND ) - MESSAGE( STATUS "bzip2 found" ) - add_definitions( -DHAS_BZIP2 ) -else() - MESSAGE( STATUS "bzip2 not found" ) - set( BZIP2_LIBRARIES "" ) -endif( BZIP2_FOUND ) - # This will become unnecessary once we update to websocketpp which fixes upstream issue #395 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWEBSOCKETPP_STRICT_MASKING") @@ -373,7 +363,6 @@ target_include_directories(fc "${readline_includes}" PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/vendor/boost_1.51/include ${CMAKE_CURRENT_SOURCE_DIR}/vendor/secp256k1-zkp ) @@ -381,7 +370,7 @@ target_include_directories(fc IF(NOT WIN32) set(LINK_USR_LOCAL_LIB -L/usr/local/lib) ENDIF() -target_link_libraries( fc PUBLIC ${LINK_USR_LOCAL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${readline_libraries} ${ECC_LIB} ) +target_link_libraries( fc PUBLIC ${LINK_USR_LOCAL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${readline_libraries} ${ECC_LIB} ) if(MSVC) set_source_files_properties( src/network/http/websocket.cpp PROPERTIES COMPILE_FLAGS "/bigobj" ) diff --git a/CMakeModules/ArgumentParser.cmake b/CMakeModules/ArgumentParser.cmake old mode 100644 new mode 100755 diff --git a/CMakeModules/FindBoost.cmake b/CMakeModules/FindBoost.cmake old mode 100644 new mode 100755 diff --git a/CMakeModules/FindReadline.cmake b/CMakeModules/FindReadline.cmake old mode 100644 new mode 100755 index f1d0d74..745cfe5 --- a/CMakeModules/FindReadline.cmake +++ b/CMakeModules/FindReadline.cmake @@ -45,5 +45,3 @@ mark_as_advanced( Readline_INCLUDE_DIR Readline_LIBRARY ) - -MESSAGE( STATUS "Found Readline: ${Readline_LIBRARY}" ) diff --git a/CMakeModules/FindVLD.cmake b/CMakeModules/FindVLD.cmake old mode 100644 new mode 100755 diff --git a/CMakeModules/ParseLibraryList.cmake b/CMakeModules/ParseLibraryList.cmake old mode 100644 new mode 100755 diff --git a/CMakeModules/SetupTargetMacros.cmake b/CMakeModules/SetupTargetMacros.cmake old mode 100644 new mode 100755 diff --git a/CMakeModules/UseLibraryMacros.cmake b/CMakeModules/UseLibraryMacros.cmake old mode 100644 new mode 100755 diff --git a/CMakeModules/VersionMacros.cmake b/CMakeModules/VersionMacros.cmake old mode 100644 new mode 100755 diff --git a/GitVersionGen/GetGitRevisionDescription.cmake b/GitVersionGen/GetGitRevisionDescription.cmake old mode 100644 new mode 100755 diff --git a/GitVersionGen/GetGitRevisionDescription.cmake.in b/GitVersionGen/GetGitRevisionDescription.cmake.in old mode 100644 new mode 100755 diff --git a/README-ecc.md b/README-ecc.md old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/fc.natvis b/fc.natvis old mode 100644 new mode 100755 diff --git a/include/fc/actor.hpp b/include/fc/actor.hpp old mode 100644 new mode 100755 diff --git a/include/fc/aligned.hpp b/include/fc/aligned.hpp old mode 100644 new mode 100755 diff --git a/include/fc/any.hpp b/include/fc/any.hpp old mode 100644 new mode 100755 diff --git a/include/fc/api.hpp b/include/fc/api.hpp old mode 100644 new mode 100755 diff --git a/include/fc/array.hpp b/include/fc/array.hpp old mode 100644 new mode 100755 diff --git a/include/fc/asio.hpp b/include/fc/asio.hpp old mode 100644 new mode 100755 diff --git a/include/fc/bitutil.hpp b/include/fc/bitutil.hpp old mode 100644 new mode 100755 diff --git a/include/fc/bloom_filter.hpp b/include/fc/bloom_filter.hpp old mode 100644 new mode 100755 diff --git a/include/fc/compress/smaz.hpp b/include/fc/compress/smaz.hpp old mode 100644 new mode 100755 diff --git a/include/fc/compress/zlib.hpp b/include/fc/compress/zlib.hpp old mode 100644 new mode 100755 diff --git a/include/fc/container/deque.hpp b/include/fc/container/deque.hpp old mode 100644 new mode 100755 diff --git a/include/fc/container/deque_fwd.hpp b/include/fc/container/deque_fwd.hpp old mode 100644 new mode 100755 diff --git a/include/fc/container/flat.hpp b/include/fc/container/flat.hpp old mode 100644 new mode 100755 diff --git a/include/fc/container/flat_fwd.hpp b/include/fc/container/flat_fwd.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/aes.hpp b/include/fc/crypto/aes.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/base36.hpp b/include/fc/crypto/base36.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/base58.hpp b/include/fc/crypto/base58.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/base64.hpp b/include/fc/crypto/base64.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/bigint.hpp b/include/fc/crypto/bigint.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/blowfish.hpp b/include/fc/crypto/blowfish.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/city.hpp b/include/fc/crypto/city.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/dh.hpp b/include/fc/crypto/dh.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/digest.hpp b/include/fc/crypto/digest.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/elliptic.hpp b/include/fc/crypto/elliptic.hpp old mode 100644 new mode 100755 index 7d3046f..bc1eae9 --- a/include/fc/crypto/elliptic.hpp +++ b/include/fc/crypto/elliptic.hpp @@ -25,9 +25,7 @@ namespace fc { typedef fc::array compact_signature; typedef std::vector range_proof_type; typedef fc::array extended_key_data; - typedef fc::sha256 blinded_hash; - typedef fc::sha256 blind_signature; - + /** * @class public_key * @brief contains only the public point of an elliptic curve key. @@ -38,7 +36,6 @@ namespace fc { public_key(); public_key(const public_key& k); ~public_key(); -// bool verify( const fc::sha256& digest, const signature& sig ); public_key_data serialize()const; public_key_point_data serialize_ecc_point()const; @@ -52,8 +49,6 @@ namespace fc { public_key child( const fc::sha256& offset )const; bool valid()const; - /** Computes new pubkey = generator * offset + old pubkey ?! */ -// public_key mult( const fc::sha256& offset )const; /** Computes new pubkey = regenerate(offset).pubkey + old pubkey * = offset * G + 1 * old pubkey ?! */ public_key add( const fc::sha256& offset )const; @@ -164,8 +159,6 @@ namespace fc { fc::string to_base58() const { return str(); } static extended_public_key from_base58( const fc::string& base58 ); - public_key generate_p( int i ) const; - public_key generate_q( int i ) const; private: sha256 c; int child_num, parent_fp; @@ -192,25 +185,10 @@ namespace fc { static extended_private_key generate_master( const fc::string& seed ); static extended_private_key generate_master( const char* seed, uint32_t seed_len ); - // Oleg Andreev's blind signature scheme, - // see http://blog.oleganza.com/post/77474860538/blind-signatures - public_key blind_public_key( const extended_public_key& bob, int i ) const; - blinded_hash blind_hash( const fc::sha256& hash, int i ) const; - blind_signature blind_sign( const blinded_hash& hash, int i ) const; - // WARNING! This may produce non-canonical signatures! - compact_signature unblind_signature( const extended_public_key& bob, - const blind_signature& sig, - const fc::sha256& hash, int i ) const; - private: extended_private_key private_derive_rest( const fc::sha512& hash, int num ) const; - private_key generate_a( int i ) const; - private_key generate_b( int i ) const; - private_key generate_c( int i ) const; - private_key generate_d( int i ) const; - private_key_secret compute_p( int i ) const; - private_key_secret compute_q( int i, const private_key_secret& p ) const; + sha256 c; int child_num, parent_fp; uint8_t depth; diff --git a/include/fc/crypto/hash_ctr_rng.hpp b/include/fc/crypto/hash_ctr_rng.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/hex.hpp b/include/fc/crypto/hex.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/hmac.hpp b/include/fc/crypto/hmac.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/md5.hpp b/include/fc/crypto/md5.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/openssl.hpp b/include/fc/crypto/openssl.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/pke.hpp b/include/fc/crypto/pke.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/rand.hpp b/include/fc/crypto/rand.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/ripemd160.hpp b/include/fc/crypto/ripemd160.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/sha1.hpp b/include/fc/crypto/sha1.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/sha224.hpp b/include/fc/crypto/sha224.hpp old mode 100644 new mode 100755 diff --git a/include/fc/crypto/sha256.hpp b/include/fc/crypto/sha256.hpp old mode 100644 new mode 100755 index 58bba9e..39b436b --- a/include/fc/crypto/sha256.hpp +++ b/include/fc/crypto/sha256.hpp @@ -119,16 +119,6 @@ namespace std }; } -namespace boost -{ - template<> - struct hash - { - size_t operator()( const fc::sha256& s )const - { - return s._hash[3];//*((size_t*)&s); - } - }; -} + #include FC_REFLECT_TYPENAME( fc::sha256 ) diff --git a/include/fc/crypto/sha512.hpp b/include/fc/crypto/sha512.hpp old mode 100644 new mode 100755 diff --git a/include/fc/exception/exception.hpp b/include/fc/exception/exception.hpp old mode 100644 new mode 100755 diff --git a/include/fc/filesystem.hpp b/include/fc/filesystem.hpp old mode 100644 new mode 100755 diff --git a/include/fc/fixed_string.hpp b/include/fc/fixed_string.hpp old mode 100644 new mode 100755 diff --git a/include/fc/fwd.hpp b/include/fc/fwd.hpp old mode 100644 new mode 100755 diff --git a/include/fc/fwd_impl.hpp b/include/fc/fwd_impl.hpp old mode 100644 new mode 100755 diff --git a/include/fc/git_revision.hpp b/include/fc/git_revision.hpp old mode 100644 new mode 100755 diff --git a/include/fc/interprocess/container.hpp b/include/fc/interprocess/container.hpp old mode 100644 new mode 100755 diff --git a/include/fc/interprocess/file_mapping.hpp b/include/fc/interprocess/file_mapping.hpp old mode 100644 new mode 100755 diff --git a/include/fc/interprocess/file_mutex.hpp b/include/fc/interprocess/file_mutex.hpp old mode 100644 new mode 100755 diff --git a/include/fc/interprocess/iprocess.hpp b/include/fc/interprocess/iprocess.hpp old mode 100644 new mode 100755 diff --git a/include/fc/interprocess/mmap_struct.hpp b/include/fc/interprocess/mmap_struct.hpp old mode 100644 new mode 100755 diff --git a/include/fc/interprocess/process.hpp b/include/fc/interprocess/process.hpp old mode 100644 new mode 100755 diff --git a/include/fc/interprocess/signals.hpp b/include/fc/interprocess/signals.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/buffered_iostream.hpp b/include/fc/io/buffered_iostream.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/console.hpp b/include/fc/io/console.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/datastream.hpp b/include/fc/io/datastream.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/datastream_back.hpp b/include/fc/io/datastream_back.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/enum_type.hpp b/include/fc/io/enum_type.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/fstream.hpp b/include/fc/io/fstream.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/iobuffer.hpp b/include/fc/io/iobuffer.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/iostream.hpp b/include/fc/io/iostream.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/json.hpp b/include/fc/io/json.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/json_relaxed.hpp b/include/fc/io/json_relaxed.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/raw.hpp b/include/fc/io/raw.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/raw_fwd.hpp b/include/fc/io/raw_fwd.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/raw_unpack_file.hpp b/include/fc/io/raw_unpack_file.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/raw_variant.hpp b/include/fc/io/raw_variant.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/sstream.hpp b/include/fc/io/sstream.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/stdio.hpp b/include/fc/io/stdio.hpp old mode 100644 new mode 100755 diff --git a/include/fc/io/varint.hpp b/include/fc/io/varint.hpp old mode 100644 new mode 100755 diff --git a/include/fc/log/appender.hpp b/include/fc/log/appender.hpp old mode 100644 new mode 100755 diff --git a/include/fc/log/console_appender.hpp b/include/fc/log/console_appender.hpp old mode 100644 new mode 100755 diff --git a/include/fc/log/file_appender.hpp b/include/fc/log/file_appender.hpp old mode 100644 new mode 100755 diff --git a/include/fc/log/gelf_appender.hpp b/include/fc/log/gelf_appender.hpp old mode 100644 new mode 100755 diff --git a/include/fc/log/log_message.hpp b/include/fc/log/log_message.hpp old mode 100644 new mode 100755 diff --git a/include/fc/log/logger.hpp b/include/fc/log/logger.hpp old mode 100644 new mode 100755 diff --git a/include/fc/log/logger_config.hpp b/include/fc/log/logger_config.hpp old mode 100644 new mode 100755 diff --git a/include/fc/make_fused.hpp b/include/fc/make_fused.hpp old mode 100644 new mode 100755 diff --git a/include/fc/network/http/connection.hpp b/include/fc/network/http/connection.hpp old mode 100644 new mode 100755 diff --git a/include/fc/network/http/server.hpp b/include/fc/network/http/server.hpp old mode 100644 new mode 100755 diff --git a/include/fc/network/http/websocket.hpp b/include/fc/network/http/websocket.hpp old mode 100644 new mode 100755 diff --git a/include/fc/network/ip.hpp b/include/fc/network/ip.hpp old mode 100644 new mode 100755 diff --git a/include/fc/network/ntp.hpp b/include/fc/network/ntp.hpp old mode 100644 new mode 100755 diff --git a/include/fc/network/rate_limiting.hpp b/include/fc/network/rate_limiting.hpp old mode 100644 new mode 100755 diff --git a/include/fc/network/resolve.hpp b/include/fc/network/resolve.hpp old mode 100644 new mode 100755 diff --git a/include/fc/network/tcp_socket.hpp b/include/fc/network/tcp_socket.hpp old mode 100644 new mode 100755 diff --git a/include/fc/network/tcp_socket_io_hooks.hpp b/include/fc/network/tcp_socket_io_hooks.hpp old mode 100644 new mode 100755 diff --git a/include/fc/network/udp_socket.hpp b/include/fc/network/udp_socket.hpp old mode 100644 new mode 100755 diff --git a/include/fc/network/url.hpp b/include/fc/network/url.hpp old mode 100644 new mode 100755 diff --git a/include/fc/noncopyable.hpp b/include/fc/noncopyable.hpp old mode 100644 new mode 100755 diff --git a/include/fc/optional.hpp b/include/fc/optional.hpp old mode 100644 new mode 100755 diff --git a/include/fc/platform_independence.hpp b/include/fc/platform_independence.hpp old mode 100644 new mode 100755 diff --git a/include/fc/real128.hpp b/include/fc/real128.hpp old mode 100644 new mode 100755 diff --git a/include/fc/reflect/reflect.hpp b/include/fc/reflect/reflect.hpp old mode 100644 new mode 100755 diff --git a/include/fc/reflect/typename.hpp b/include/fc/reflect/typename.hpp old mode 100644 new mode 100755 index 312c927..5cd55c9 --- a/include/fc/reflect/typename.hpp +++ b/include/fc/reflect/typename.hpp @@ -15,7 +15,7 @@ namespace fc { class exception; namespace ip { class address; } - template class get_typename{}; + template struct get_typename; template<> struct get_typename { static const char* name() { return "int32_t"; } }; template<> struct get_typename { static const char* name() { return "int64_t"; } }; template<> struct get_typename { static const char* name() { return "int16_t"; } }; diff --git a/include/fc/reflect/variant.hpp b/include/fc/reflect/variant.hpp old mode 100644 new mode 100755 diff --git a/include/fc/rpc/api_connection.hpp b/include/fc/rpc/api_connection.hpp old mode 100644 new mode 100755 diff --git a/include/fc/rpc/binary_api_connection.hpp b/include/fc/rpc/binary_api_connection.hpp old mode 100644 new mode 100755 diff --git a/include/fc/rpc/bstate.hpp b/include/fc/rpc/bstate.hpp old mode 100644 new mode 100755 diff --git a/include/fc/rpc/cli.hpp b/include/fc/rpc/cli.hpp old mode 100644 new mode 100755 diff --git a/include/fc/rpc/http_api.hpp b/include/fc/rpc/http_api.hpp old mode 100644 new mode 100755 diff --git a/include/fc/rpc/json_connection.hpp b/include/fc/rpc/json_connection.hpp old mode 100644 new mode 100755 diff --git a/include/fc/rpc/state.hpp b/include/fc/rpc/state.hpp old mode 100644 new mode 100755 diff --git a/include/fc/rpc/variant_connection.hpp b/include/fc/rpc/variant_connection.hpp old mode 100644 new mode 100755 diff --git a/include/fc/rpc/variant_stream.hpp b/include/fc/rpc/variant_stream.hpp old mode 100644 new mode 100755 diff --git a/include/fc/rpc/websocket_api.hpp b/include/fc/rpc/websocket_api.hpp old mode 100644 new mode 100755 diff --git a/include/fc/safe.hpp b/include/fc/safe.hpp old mode 100644 new mode 100755 diff --git a/include/fc/scoped_exit.hpp b/include/fc/scoped_exit.hpp old mode 100644 new mode 100755 diff --git a/include/fc/shared_ptr.hpp b/include/fc/shared_ptr.hpp old mode 100644 new mode 100755 diff --git a/include/fc/signal.hpp b/include/fc/signal.hpp old mode 100644 new mode 100755 diff --git a/include/fc/signals.hpp b/include/fc/signals.hpp old mode 100644 new mode 100755 diff --git a/include/fc/smart_ref_fwd.hpp b/include/fc/smart_ref_fwd.hpp old mode 100644 new mode 100755 diff --git a/include/fc/smart_ref_impl.hpp b/include/fc/smart_ref_impl.hpp old mode 100644 new mode 100755 diff --git a/include/fc/static_variant.hpp b/include/fc/static_variant.hpp old mode 100644 new mode 100755 index 9aab790..d6206c2 --- a/include/fc/static_variant.hpp +++ b/include/fc/static_variant.hpp @@ -382,5 +382,5 @@ struct visitor { s.visit( to_static_variant(ar[1]) ); } - template struct get_typename { static const char* name() { return typeid(static_variant).name(); } }; + template struct get_typename { static const char* name() { return typeid(static_variant).name(); } }; } // namespace fc diff --git a/include/fc/string.hpp b/include/fc/string.hpp old mode 100644 new mode 100755 diff --git a/include/fc/thread/future.hpp b/include/fc/thread/future.hpp old mode 100644 new mode 100755 diff --git a/include/fc/thread/mutex.hpp b/include/fc/thread/mutex.hpp old mode 100644 new mode 100755 diff --git a/include/fc/thread/non_preemptable_scope_check.hpp b/include/fc/thread/non_preemptable_scope_check.hpp old mode 100644 new mode 100755 diff --git a/include/fc/thread/priority.hpp b/include/fc/thread/priority.hpp old mode 100644 new mode 100755 diff --git a/include/fc/thread/scoped_lock.hpp b/include/fc/thread/scoped_lock.hpp old mode 100644 new mode 100755 diff --git a/include/fc/thread/spin_lock.hpp b/include/fc/thread/spin_lock.hpp old mode 100644 new mode 100755 diff --git a/include/fc/thread/spin_yield_lock.hpp b/include/fc/thread/spin_yield_lock.hpp old mode 100644 new mode 100755 diff --git a/include/fc/thread/task.hpp b/include/fc/thread/task.hpp old mode 100644 new mode 100755 diff --git a/include/fc/thread/thread.hpp b/include/fc/thread/thread.hpp old mode 100644 new mode 100755 diff --git a/include/fc/thread/thread_specific.hpp b/include/fc/thread/thread_specific.hpp old mode 100644 new mode 100755 diff --git a/include/fc/thread/unique_lock.hpp b/include/fc/thread/unique_lock.hpp old mode 100644 new mode 100755 diff --git a/include/fc/thread/wait_condition.hpp b/include/fc/thread/wait_condition.hpp old mode 100644 new mode 100755 diff --git a/include/fc/time.hpp b/include/fc/time.hpp old mode 100644 new mode 100755 diff --git a/include/fc/tuple.hpp b/include/fc/tuple.hpp old mode 100644 new mode 100755 diff --git a/include/fc/uint128.hpp b/include/fc/uint128.hpp old mode 100644 new mode 100755 diff --git a/include/fc/unique_ptr.hpp b/include/fc/unique_ptr.hpp old mode 100644 new mode 100755 diff --git a/include/fc/utf8.hpp b/include/fc/utf8.hpp old mode 100644 new mode 100755 diff --git a/include/fc/utility.hpp b/include/fc/utility.hpp old mode 100644 new mode 100755 diff --git a/include/fc/variant.hpp b/include/fc/variant.hpp old mode 100644 new mode 100755 diff --git a/include/fc/variant_object.hpp b/include/fc/variant_object.hpp old mode 100644 new mode 100755 diff --git a/include/fc/vector.hpp b/include/fc/vector.hpp old mode 100644 new mode 100755 diff --git a/include/fc/vector_fwd.hpp b/include/fc/vector_fwd.hpp old mode 100644 new mode 100755 diff --git a/include/fc/wait_any.hpp b/include/fc/wait_any.hpp old mode 100644 new mode 100755 diff --git a/src/asio.cpp b/src/asio.cpp old mode 100644 new mode 100755 diff --git a/src/byteswap.hpp b/src/byteswap.hpp old mode 100644 new mode 100755 diff --git a/src/compress/miniz.c b/src/compress/miniz.c old mode 100644 new mode 100755 diff --git a/src/compress/smaz.cpp b/src/compress/smaz.cpp old mode 100644 new mode 100755 diff --git a/src/compress/zlib.cpp b/src/compress/zlib.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/_digest_common.cpp b/src/crypto/_digest_common.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/_digest_common.hpp b/src/crypto/_digest_common.hpp old mode 100644 new mode 100755 diff --git a/src/crypto/_elliptic_impl_priv.hpp b/src/crypto/_elliptic_impl_priv.hpp old mode 100644 new mode 100755 diff --git a/src/crypto/_elliptic_impl_pub.hpp b/src/crypto/_elliptic_impl_pub.hpp old mode 100644 new mode 100755 diff --git a/src/crypto/aes.cpp b/src/crypto/aes.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/base36.cpp b/src/crypto/base36.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/base58.cpp b/src/crypto/base58.cpp old mode 100644 new mode 100755 index e1d5d33..ad1b7de --- a/src/crypto/base58.cpp +++ b/src/crypto/base58.cpp @@ -66,74 +66,72 @@ public: /** C++ wrapper for BIGNUM (OpenSSL bignum) */ -class CBigNum : public BIGNUM +class CBigNum { + BIGNUM* bn; public: CBigNum() - { - BN_init(this); - } + : bn(BN_new()) {} CBigNum(const CBigNum& b) + : CBigNum() { - BN_init(this); - if (!BN_copy(this, &b)) + if (!BN_copy(bn, b.bn)) { - BN_clear_free(this); + BN_clear_free(bn); throw bignum_error("CBigNum::CBigNum(const CBigNum&) : BN_copy failed"); } } CBigNum& operator=(const CBigNum& b) { - if (!BN_copy(this, &b)) + if (!BN_copy(bn, b.bn)) throw bignum_error("CBigNum::operator= : BN_copy failed"); return (*this); } ~CBigNum() { - BN_clear_free(this); + BN_clear_free(bn); } //CBigNum(char n) is not portable. Use 'signed char' or 'unsigned char'. - CBigNum(signed char n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } - CBigNum(short n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } - CBigNum(int n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } - //CBigNum(long n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } - CBigNum(int64_t n) { BN_init(this); setint64(n); } - CBigNum(unsigned char n) { BN_init(this); setulong(n); } - CBigNum(unsigned short n) { BN_init(this); setulong(n); } - CBigNum(unsigned int n) { BN_init(this); setulong(n); } - //CBigNum(unsigned long n) { BN_init(this); setulong(n); } - CBigNum(uint64_t n) { BN_init(this); setuint64(n); } + CBigNum(signed char n) :CBigNum() { if (n >= 0) setulong(n); else setint64(n); } + CBigNum(short n) :CBigNum() { if (n >= 0) setulong(n); else setint64(n); } + CBigNum(int n) :CBigNum() { if (n >= 0) setulong(n); else setint64(n); } + CBigNum(int64_t n) :CBigNum() { setint64(n); } + CBigNum(unsigned char n) :CBigNum() { setulong(n); } + CBigNum(unsigned short n) :CBigNum() { setulong(n); } + CBigNum(unsigned int n) :CBigNum() { setulong(n); } + CBigNum(uint64_t n) :CBigNum() { setuint64(n); } + explicit CBigNum(const std::vector& vch) + : CBigNum() { - BN_init(this); setvch(vch); } void setulong(unsigned long n) { - if (!BN_set_word(this, n)) + if (!BN_set_word(bn, n)) throw bignum_error("CBigNum conversion from unsigned long : BN_set_word failed"); } unsigned long getulong() const { - return BN_get_word(this); + return BN_get_word(bn); } unsigned int getuint() const { - return BN_get_word(this); + return BN_get_word(bn); } int getint() const { - unsigned long n = BN_get_word(this); - if (!BN_is_negative(this)) + unsigned long n = BN_get_word(bn); + if (!BN_is_negative(bn)) return (n > (unsigned long)std::numeric_limits::max() ? std::numeric_limits::max() : n); else return (n > (unsigned long)std::numeric_limits::max() ? std::numeric_limits::min() : -(int)n); @@ -171,7 +169,7 @@ public: pch[1] = (nSize >> 16) & 0xff; pch[2] = (nSize >> 8) & 0xff; pch[3] = (nSize) & 0xff; - BN_mpi2bn(pch, p - pch, this); + BN_mpi2bn(pch, p - pch, bn); } void setuint64(uint64_t n) @@ -198,7 +196,7 @@ public: pch[1] = (nSize >> 16) & 0xff; pch[2] = (nSize >> 8) & 0xff; pch[3] = (nSize) & 0xff; - BN_mpi2bn(pch, p - pch, this); + BN_mpi2bn(pch, p - pch, bn); } @@ -214,16 +212,16 @@ public: vch2[3] = (nSize >> 0) & 0xff; // swap data to big endian reverse_copy(vch.begin(), vch.end(), vch2.begin() + 4); - BN_mpi2bn(&vch2[0], vch2.size(), this); + BN_mpi2bn(&vch2[0], vch2.size(), bn); } std::vector getvch() const { - unsigned int nSize = BN_bn2mpi(this, NULL); + unsigned int nSize = BN_bn2mpi(bn, NULL); if (nSize <= 4) return std::vector(); std::vector vch(nSize); - BN_bn2mpi(this, &vch[0]); + BN_bn2mpi(bn, &vch[0]); vch.erase(vch.begin(), vch.begin() + 4); reverse(vch.begin(), vch.end()); return vch; @@ -237,16 +235,16 @@ public: if (nSize >= 1) vch[4] = (nCompact >> 16) & 0xff; if (nSize >= 2) vch[5] = (nCompact >> 8) & 0xff; if (nSize >= 3) vch[6] = (nCompact >> 0) & 0xff; - BN_mpi2bn(&vch[0], vch.size(), this); + BN_mpi2bn(&vch[0], vch.size(), bn); return *this; } unsigned int GetCompact() const { - unsigned int nSize = BN_bn2mpi(this, NULL); + unsigned int nSize = BN_bn2mpi(bn, NULL); std::vector vch(nSize); nSize -= 4; - BN_bn2mpi(this, &vch[0]); + BN_bn2mpi(bn, &vch[0]); unsigned int nCompact = nSize << 24; if (nSize >= 1) nCompact |= (vch[4] << 16); if (nSize >= 2) nCompact |= (vch[5] << 8); @@ -281,7 +279,7 @@ public: *this += n; } if (fNegative) - *this = 0 - *this; + BN_set_negative(bn, 1); } std::string ToString(int nBase=10) const @@ -291,20 +289,20 @@ public: CBigNum bn0 = 0; std::string str; CBigNum bn = *this; - BN_set_negative(&bn, false); + BN_set_negative(bn.bn, false); CBigNum dv; CBigNum rem; - if (BN_cmp(&bn, &bn0) == 0) + if (BN_cmp(bn.bn, bn0.bn) == 0) return "0"; - while (BN_cmp(&bn, &bn0) > 0) + while (BN_cmp(bn.bn, bn0.bn) > 0) { - if (!BN_div(&dv, &rem, &bn, &bnBase, pctx)) + if (!BN_div(dv.bn, rem.bn, bn.bn, bnBase.bn, pctx)) throw bignum_error("CBigNum::ToString() : BN_div failed"); bn = dv; unsigned int c = rem.getulong(); str += "0123456789abcdef"[c]; } - if (BN_is_negative(this)) + if (BN_is_negative(this->bn)) str += "-"; reverse(str.begin(), str.end()); return str; @@ -319,45 +317,50 @@ public: bool operator!() const { - return BN_is_zero(this); + return BN_is_zero(bn); } CBigNum& operator+=(const CBigNum& b) { - if (!BN_add(this, this, &b)) + if (!BN_add(bn, bn, b.bn)) throw bignum_error("CBigNum::operator+= : BN_add failed"); return *this; } CBigNum& operator-=(const CBigNum& b) { - *this = *this - b; + if (!BN_sub(bn, bn, b.bn)) + throw bignum_error("CBigNum::operator-= : BN_sub failed"); return *this; } CBigNum& operator*=(const CBigNum& b) { CAutoBN_CTX pctx; - if (!BN_mul(this, this, &b, pctx)) + if (!BN_mul(bn, bn, b.bn, pctx)) throw bignum_error("CBigNum::operator*= : BN_mul failed"); return *this; } CBigNum& operator/=(const CBigNum& b) { - *this = *this / b; + CAutoBN_CTX pctx; + if (!BN_div(bn, NULL, bn, b.bn, pctx)) + throw bignum_error("CBigNum::operator/= : BN_div failed"); return *this; } CBigNum& operator%=(const CBigNum& b) { - *this = *this % b; + CAutoBN_CTX pctx; + if (!BN_div(NULL, bn, bn, b.bn, pctx)) + throw bignum_error("CBigNum::operator%= : BN_div failed"); return *this; } CBigNum& operator<<=(unsigned int shift) { - if (!BN_lshift(this, this, shift)) + if (!BN_lshift(bn, bn, shift)) throw bignum_error("CBigNum:operator<<= : BN_lshift failed"); return *this; } @@ -368,13 +371,13 @@ public: // if built on ubuntu 9.04 or 9.10, probably depends on version of openssl CBigNum a = 1; a <<= shift; - if (BN_cmp(&a, this) > 0) + if (BN_cmp(a.bn, bn) > 0) { *this = 0; return *this; } - if (!BN_rshift(this, this, shift)) + if (!BN_rshift(bn, bn, shift)) throw bignum_error("CBigNum:operator>>= : BN_rshift failed"); return *this; } @@ -383,7 +386,7 @@ public: CBigNum& operator++() { // prefix operator - if (!BN_add(this, this, BN_value_one())) + if (!BN_add(bn, bn, BN_value_one())) throw bignum_error("CBigNum::operator++ : BN_add failed"); return *this; } @@ -400,7 +403,7 @@ public: { // prefix operator CBigNum r; - if (!BN_sub(&r, this, BN_value_one())) + if (!BN_sub(r.bn, bn, BN_value_one())) throw bignum_error("CBigNum::operator-- : BN_sub failed"); *this = r; return *this; @@ -414,10 +417,12 @@ public: return ret; } - - friend inline const CBigNum operator-(const CBigNum& a, const CBigNum& b); - friend inline const CBigNum operator/(const CBigNum& a, const CBigNum& b); - friend inline const CBigNum operator%(const CBigNum& a, const CBigNum& b); + const BIGNUM* to_bignum() const { + return bn; + } + BIGNUM* to_bignum() { + return bn; + } }; @@ -425,7 +430,7 @@ public: inline const CBigNum operator+(const CBigNum& a, const CBigNum& b) { CBigNum r; - if (!BN_add(&r, &a, &b)) + if (!BN_add(r.to_bignum(), a.to_bignum(), b.to_bignum())) throw bignum_error("CBigNum::operator+ : BN_add failed"); return r; } @@ -433,7 +438,7 @@ inline const CBigNum operator+(const CBigNum& a, const CBigNum& b) inline const CBigNum operator-(const CBigNum& a, const CBigNum& b) { CBigNum r; - if (!BN_sub(&r, &a, &b)) + if (!BN_sub(r.to_bignum(), a.to_bignum(), b.to_bignum())) throw bignum_error("CBigNum::operator- : BN_sub failed"); return r; } @@ -441,7 +446,7 @@ inline const CBigNum operator-(const CBigNum& a, const CBigNum& b) inline const CBigNum operator-(const CBigNum& a) { CBigNum r(a); - BN_set_negative(&r, !BN_is_negative(&r)); + BN_set_negative(r.to_bignum(), !BN_is_negative(r.to_bignum())); return r; } @@ -449,7 +454,7 @@ inline const CBigNum operator*(const CBigNum& a, const CBigNum& b) { CAutoBN_CTX pctx; CBigNum r; - if (!BN_mul(&r, &a, &b, pctx)) + if (!BN_mul(r.to_bignum(), a.to_bignum(), b.to_bignum(), pctx)) throw bignum_error("CBigNum::operator* : BN_mul failed"); return r; } @@ -458,7 +463,7 @@ inline const CBigNum operator/(const CBigNum& a, const CBigNum& b) { CAutoBN_CTX pctx; CBigNum r; - if (!BN_div(&r, NULL, &a, &b, pctx)) + if (!BN_div(r.to_bignum(), NULL, a.to_bignum(), b.to_bignum(), pctx)) throw bignum_error("CBigNum::operator/ : BN_div failed"); return r; } @@ -467,7 +472,7 @@ inline const CBigNum operator%(const CBigNum& a, const CBigNum& b) { CAutoBN_CTX pctx; CBigNum r; - if (!BN_mod(&r, &a, &b, pctx)) + if (!BN_mod(r.to_bignum(), a.to_bignum(), b.to_bignum(), pctx)) throw bignum_error("CBigNum::operator% : BN_div failed"); return r; } @@ -475,7 +480,7 @@ inline const CBigNum operator%(const CBigNum& a, const CBigNum& b) inline const CBigNum operator<<(const CBigNum& a, unsigned int shift) { CBigNum r; - if (!BN_lshift(&r, &a, shift)) + if (!BN_lshift(r.to_bignum(), a.to_bignum(), shift)) throw bignum_error("CBigNum:operator<< : BN_lshift failed"); return r; } @@ -487,12 +492,12 @@ inline const CBigNum operator>>(const CBigNum& a, unsigned int shift) return r; } -inline bool operator==(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) == 0); } -inline bool operator!=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) != 0); } -inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) <= 0); } -inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) >= 0); } -inline bool operator<(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) < 0); } -inline bool operator>(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) > 0); } +inline bool operator==(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) == 0); } +inline bool operator!=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) != 0); } +inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) <= 0); } +inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) >= 0); } +inline bool operator<(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) < 0); } +inline bool operator>(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) > 0); } static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; @@ -522,7 +527,7 @@ inline std::string EncodeBase58(const unsigned char* pbegin, const unsigned char CBigNum rem; while (bn > bn0) { - if (!BN_div(&dv, &rem, &bn, &bn58, pctx)) + if (!BN_div(dv.to_bignum(), rem.to_bignum(), bn.to_bignum(), bn58.to_bignum(), pctx)) throw bignum_error("EncodeBase58 : BN_div failed"); bn = dv; unsigned int c = rem.getulong(); @@ -572,7 +577,7 @@ inline bool DecodeBase58(const char* psz, std::vector& vchRet) break; } bnChar.setulong(p1 - pszBase58); - if (!BN_mul(&bn, &bn, &bn58, pctx)) + if (!BN_mul(bn.to_bignum(), bn.to_bignum(), bn58.to_bignum(), pctx)) throw bignum_error("DecodeBase58 : BN_mul failed"); bn += bnChar; } diff --git a/src/crypto/base64.cpp b/src/crypto/base64.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/bigint.cpp b/src/crypto/bigint.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/blowfish.cpp b/src/crypto/blowfish.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/city.cpp b/src/crypto/city.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/crc.cpp b/src/crypto/crc.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/dh.cpp b/src/crypto/dh.cpp old mode 100644 new mode 100755 index cbd7dcc..7e87437 --- a/src/crypto/dh.cpp +++ b/src/crypto/dh.cpp @@ -12,10 +12,19 @@ namespace fc { bool diffie_hellman::generate_params( int s, uint8_t g ) { - ssl_dh dh = DH_generate_parameters( s, g, NULL, NULL ); + ssl_dh dh(DH_new()); + DH_generate_parameters_ex(dh.obj, s, g, NULL); +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + const BIGNUM* bn_p; // must not be free'd! + DH_get0_pqg(dh.obj, &bn_p, NULL, NULL); + p.resize( BN_num_bytes( bn_p ) ); + if( p.size() ) + BN_bn2bin( bn_p, (unsigned char*)&p.front() ); +#else p.resize( BN_num_bytes( dh->p ) ); if( p.size() ) BN_bn2bin( dh->p, (unsigned char*)&p.front() ); +#endif this->g = g; return fc::validate( dh, valid ); } @@ -25,8 +34,14 @@ namespace fc { if( !p.size() ) return valid = false; ssl_dh dh = DH_new(); +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + const auto bn_p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL ); + const auto bn_g = BN_bin2bn( (unsigned char*)&g, 1, NULL ); + DH_set0_pqg(dh.obj, bn_p, NULL, bn_g); +#else dh->p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL ); dh->g = BN_bin2bn( (unsigned char*)&g, 1, NULL ); +#endif return fc::validate( dh, valid ); } @@ -35,8 +50,14 @@ namespace fc { if( !p.size() ) return valid = false; ssl_dh dh = DH_new(); +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + const auto bn_p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL ); + const auto bn_g = BN_bin2bn( (unsigned char*)&g, 1, NULL ); + DH_set0_pqg(dh.obj, bn_p, NULL, bn_g); +#else dh->p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL ); dh->g = BN_bin2bn( (unsigned char*)&g, 1, NULL ); +#endif if( !fc::validate( dh, valid ) ) { @@ -44,21 +65,42 @@ namespace fc { } DH_generate_key(dh); +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + const BIGNUM* bn_pub_key; // must not be free'd! + const BIGNUM* bn_priv_key; // must not be free'd! + DH_get0_key(dh.obj, &bn_pub_key, &bn_priv_key); + pub_key.resize( BN_num_bytes( bn_pub_key ) ); + priv_key.resize( BN_num_bytes( bn_priv_key ) ); + if( pub_key.size() ) + BN_bn2bin( bn_pub_key, (unsigned char*)&pub_key.front() ); + if( priv_key.size() ) + BN_bn2bin( bn_priv_key, (unsigned char*)&priv_key.front() ); +#else pub_key.resize( BN_num_bytes( dh->pub_key ) ); priv_key.resize( BN_num_bytes( dh->priv_key ) ); if( pub_key.size() ) BN_bn2bin( dh->pub_key, (unsigned char*)&pub_key.front() ); if( priv_key.size() ) BN_bn2bin( dh->priv_key, (unsigned char*)&priv_key.front() ); +#endif return true; } bool diffie_hellman::compute_shared_key( const char* buf, uint32_t s ) { ssl_dh dh = DH_new(); +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + auto bn_p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL ); + auto bn_pub_key = BN_bin2bn( (unsigned char*)&pub_key.front(), pub_key.size(), NULL ); + auto bn_priv_key = BN_bin2bn( (unsigned char*)&priv_key.front(), priv_key.size(), NULL ); + auto bn_g = BN_bin2bn( (unsigned char*)&g, 1, NULL ); + DH_set0_pqg(dh.obj, bn_p, NULL, bn_g); + DH_set0_key(dh.obj, bn_pub_key, bn_priv_key); +#else dh->p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL ); dh->pub_key = BN_bin2bn( (unsigned char*)&pub_key.front(), pub_key.size(), NULL ); dh->priv_key = BN_bin2bn( (unsigned char*)&priv_key.front(), priv_key.size(), NULL ); dh->g = BN_bin2bn( (unsigned char*)&g, 1, NULL ); +#endif int check; DH_check(dh,&check); diff --git a/src/crypto/elliptic_common.cpp b/src/crypto/elliptic_common.cpp old mode 100644 new mode 100755 index 66b75d0..16a57cb --- a/src/crypto/elliptic_common.cpp +++ b/src/crypto/elliptic_common.cpp @@ -231,11 +231,12 @@ namespace fc { namespace ecc { static fc::string _to_base58( const extended_key_data& key ) { - char *buffer = (char*)alloca(key.size() + 4); + size_t buf_len = key.size() + 4; + char *buffer = (char*)alloca(buf_len); memcpy( buffer, key.begin(), key.size() ); fc::sha256 double_hash = fc::sha256::hash( fc::sha256::hash( key.begin(), key.size() )); memcpy( buffer + key.size(), double_hash.data(), 4 ); - return fc::to_base58( buffer, sizeof(buffer) ); + return fc::to_base58( buffer, buf_len ); } static void _parse_extended_data( unsigned char* buffer, fc::string base58 ) @@ -301,9 +302,6 @@ namespace fc { namespace ecc { return extended_public_key( get_public_key(), c, child_num, parent_fp, depth ); } - public_key extended_public_key::generate_p(int i) const { return derive_normal_child(2*i + 0); } - public_key extended_public_key::generate_q(int i) const { return derive_normal_child(2*i + 1); } - extended_private_key extended_private_key::derive_child(int i) const { return i < 0 ? derive_hardened_child(i) : derive_normal_child(i); @@ -346,11 +344,6 @@ namespace fc { namespace ecc { return from_base58( _to_base58( data ) ); } - private_key extended_private_key::generate_a(int i) const { return derive_hardened_child(4*i + 0); } - private_key extended_private_key::generate_b(int i) const { return derive_hardened_child(4*i + 1); } - private_key extended_private_key::generate_c(int i) const { return derive_hardened_child(4*i + 2); } - private_key extended_private_key::generate_d(int i) const { return derive_hardened_child(4*i + 3); } - fc::string extended_private_key::str() const { return _to_base58( serialize_extended() ); diff --git a/src/crypto/elliptic_impl_priv.cpp b/src/crypto/elliptic_impl_priv.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/elliptic_impl_pub.cpp b/src/crypto/elliptic_impl_pub.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/elliptic_mixed.cpp b/src/crypto/elliptic_mixed.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/elliptic_openssl.cpp b/src/crypto/elliptic_openssl.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/elliptic_secp256k1.cpp b/src/crypto/elliptic_secp256k1.cpp old mode 100644 new mode 100755 index 91edc18..515d086 --- a/src/crypto/elliptic_secp256k1.cpp +++ b/src/crypto/elliptic_secp256k1.cpp @@ -185,164 +185,6 @@ namespace fc { namespace ecc { return result; } - static void to_bignum( const unsigned char* in, ssl_bignum& out, unsigned int len ) - { - if ( *in & 0x80 ) - { - unsigned char *buffer = (unsigned char*)alloca(len + 1); - *buffer = 0; - memcpy( buffer + 1, in, len ); - BN_bin2bn( buffer, sizeof(buffer), out ); - } - else - { - BN_bin2bn( in, len, out ); - } - } - - static void to_bignum( const private_key_secret& in, ssl_bignum& out ) - { - to_bignum( (unsigned char*) in.data(), out, in.data_size() ); - } - - static void from_bignum( const ssl_bignum& in, unsigned char* out, unsigned int len ) - { - unsigned int l = BN_num_bytes( in ); - if ( l > len ) - { - unsigned char *buffer = (unsigned char*)alloca(l); - BN_bn2bin( in, buffer ); - memcpy( out, buffer + l - len, len ); - } - else - { - memset( out, 0, len - l ); - BN_bn2bin( in, out + len - l ); - } - } - - static void from_bignum( const ssl_bignum& in, private_key_secret& out ) - { - from_bignum( in, (unsigned char*) out.data(), out.data_size() ); - } - - static void invert( const private_key_secret& in, private_key_secret& out ) - { - ssl_bignum bn_in; - to_bignum( in, bn_in ); - ssl_bignum bn_n; - to_bignum( detail::get_curve_order(), bn_n ); - ssl_bignum bn_inv; - bn_ctx ctx( BN_CTX_new() ); - FC_ASSERT( BN_mod_inverse( bn_inv, bn_in, bn_n, ctx ) ); - from_bignum( bn_inv, out ); - } - - static void to_point( const public_key_data& in, ec_point& out ) - { - bn_ctx ctx( BN_CTX_new() ); - const ec_group& curve = detail::get_curve(); - private_key_secret x; - memcpy( x.data(), in.begin() + 1, x.data_size() ); - ssl_bignum bn_x; - to_bignum( x, bn_x ); - FC_ASSERT( EC_POINT_set_compressed_coordinates_GFp( curve, out, bn_x, *in.begin() & 1, ctx ) > 0 ); - } - - static void from_point( const ec_point& in, public_key_data& out ) - { - bn_ctx ctx( BN_CTX_new() ); - const ec_group& curve = detail::get_curve(); - ssl_bignum bn_x; - ssl_bignum bn_y; - FC_ASSERT( EC_POINT_get_affine_coordinates_GFp( curve, in, bn_x, bn_y, ctx ) > 0 ); - private_key_secret x; - from_bignum( bn_x, x ); - memcpy( out.begin() + 1, x.data(), out.size() - 1 ); - *out.begin() = BN_is_bit_set( bn_y, 0 ) ? 3 : 2; - } - -// static void print(const unsigned char* data) { -// for (int i = 0; i < 32; i++) { -// printf("%02x", *data++); -// } -// } -// -// static void print(private_key_secret key) { -// print((unsigned char*) key.data()); -// } -// -// static void print(public_key_data key) { -// print((unsigned char*) key.begin() + 1); -// } - - static void canonicalize( unsigned char *int256 ) - { - fc::sha256 biggi( (char*) int256, 32 ); - if ( detail::get_half_curve_order() >= biggi ) - { - return; // nothing to do - } - ssl_bignum bn_k; - to_bignum( int256, bn_k, 32 ); - ssl_bignum bn_n; - to_bignum( detail::get_curve_order(), bn_n ); - FC_ASSERT( BN_sub( bn_k, bn_n, bn_k ) ); - from_bignum( bn_k, int256, 32 ); - } - - static public_key compute_k( const private_key_secret& a, const private_key_secret& c, - const public_key& p ) - { - private_key_secret prod = a; - FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) prod.data(), (unsigned char*) c.data() ) > 0 ); - invert( prod, prod ); - public_key_data P = p.serialize(); - FC_ASSERT( secp256k1_ec_pubkey_tweak_mul( detail::_get_context(), (unsigned char*) P.begin(), P.size(), (unsigned char*) prod.data() ) ); -// printf("K: "); print(P); printf("\n"); - return public_key( P ); - } - - static public_key compute_t( const private_key_secret& a, const private_key_secret& b, - const private_key_secret& c, const private_key_secret& d, - const public_key_data& p, const public_key_data& q ) - { - private_key_secret prod; - invert( c, prod ); // prod == c^-1 - FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) prod.data(), (unsigned char*) d.data() ) > 0 ); - // prod == c^-1 * d - - public_key_data accu = p; - FC_ASSERT( secp256k1_ec_pubkey_tweak_mul( detail::_get_context(), (unsigned char*) accu.begin(), accu.size(), (unsigned char*) prod.data() ) ); - // accu == prod * P == c^-1 * d * P - - ec_point point_accu( EC_POINT_new( detail::get_curve() ) ); - to_point( accu, point_accu ); - ec_point point_q( EC_POINT_new( detail::get_curve() ) ); - to_point( q, point_q ); - bn_ctx ctx(BN_CTX_new()); - FC_ASSERT( EC_POINT_add( detail::get_curve(), point_accu, point_accu, point_q, ctx ) > 0 ); - from_point( point_accu, accu ); - // accu == c^-1 * a * P + Q - - FC_ASSERT( secp256k1_ec_pubkey_tweak_add( detail::_get_context(), (unsigned char*) accu.begin(), accu.size(), (unsigned char*) b.data() ) ); - // accu == c^-1 * a * P + Q + b*G - - public_key_data k = compute_k( a, c, p ).serialize(); - memcpy( prod.data(), k.begin() + 1, prod.data_size() ); - // prod == Kx - FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) prod.data(), (unsigned char*) a.data() ) > 0 ); - // prod == Kx * a - invert( prod, prod ); - // prod == (Kx * a)^-1 - - FC_ASSERT( secp256k1_ec_pubkey_tweak_mul( detail::_get_context(), (unsigned char*) accu.begin(), accu.size(), (unsigned char*) prod.data() ) ); - // accu == (c^-1 * a * P + Q + b*G) * (Kx * a)^-1 - -// printf("T: "); print(accu); printf("\n"); - return public_key( accu ); - } - extended_private_key::extended_private_key( const private_key& k, const sha256& c, int child, int parent, uint8_t depth ) : private_key(k), c(c), child_num(child), parent_fp(parent), depth(depth) { } @@ -358,102 +200,6 @@ namespace fc { namespace ecc { return result; } - public_key extended_private_key::blind_public_key( const extended_public_key& bob, int i ) const - { - private_key_secret a = generate_a(i).get_secret(); - private_key_secret b = generate_b(i).get_secret(); - private_key_secret c = generate_c(i).get_secret(); - private_key_secret d = generate_d(i).get_secret(); - public_key_data p = bob.generate_p(i).serialize(); - public_key_data q = bob.generate_q(i).serialize(); -// printf("a: "); print(a); printf("\n"); -// printf("b: "); print(b); printf("\n"); -// printf("c: "); print(c); printf("\n"); -// printf("d: "); print(d); printf("\n"); -// printf("P: "); print(p); printf("\n"); -// printf("Q: "); print(q); printf("\n"); - return compute_t( a, b, c, d, p, q ); - } - - blinded_hash extended_private_key::blind_hash( const fc::sha256& hash, int i ) const - { - private_key_secret a = generate_a(i).get_secret(); - private_key_secret b = generate_b(i).get_secret(); - FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) a.data(), (unsigned char*) hash.data() ) > 0 ); - FC_ASSERT( secp256k1_ec_privkey_tweak_add( detail::_get_context(), (unsigned char*) a.data(), (unsigned char*) b.data() ) > 0 ); -// printf("hash: "); print(hash); printf("\n"); -// printf("blinded: "); print(a); printf("\n"); - return a; - } - - private_key_secret extended_private_key::compute_p( int i ) const - { - private_key_secret p_inv = derive_normal_child( 2*i ).get_secret(); - invert( p_inv, p_inv ); -// printf("p: "); print(p_inv); printf("\n"); - return p_inv; - } - - private_key_secret extended_private_key::compute_q( int i, const private_key_secret& p ) const - { - private_key_secret q = derive_normal_child( 2*i + 1 ).get_secret(); - FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) q.data(), (unsigned char*) p.data() ) > 0 ); -// printf("q: "); print(q); printf("\n"); - return q; - } - - blind_signature extended_private_key::blind_sign( const blinded_hash& hash, int i ) const - { - private_key_secret p = compute_p( i ); - private_key_secret q = compute_q( i, p ); - FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) p.data(), (unsigned char*) hash.data() ) > 0 ); - FC_ASSERT( secp256k1_ec_privkey_tweak_add( detail::_get_context(), (unsigned char*) p.data(), (unsigned char*) q.data() ) > 0 ); -// printf("blind_sig: "); print(p); printf("\n"); - return p; - } - - compact_signature extended_private_key::unblind_signature( const extended_public_key& bob, - const blind_signature& sig, - const fc::sha256& hash, - int i ) const - { - private_key_secret a = generate_a(i).get_secret(); - private_key_secret b = generate_b(i).get_secret(); - private_key_secret c = generate_c(i).get_secret(); - private_key_secret d = generate_d(i).get_secret(); - public_key p = bob.generate_p(i); - public_key q = bob.generate_q(i); - public_key_data k = compute_k( a, c, p ); - public_key_data t = compute_t( a, b, c, d, p, q ).serialize(); - - FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) c.data(), (unsigned char*) sig.data() ) > 0 ); - FC_ASSERT( secp256k1_ec_privkey_tweak_add( detail::_get_context(), (unsigned char*) c.data(), (unsigned char*) d.data() ) > 0 ); - - compact_signature result; - memcpy( result.begin() + 1, k.begin() + 1, 32 ); - memcpy( result.begin() + 33, c.data(), 32 ); - canonicalize( result.begin() + 33 ); -// printf("unblinded: "); print(result.begin() + 33); printf("\n"); - for ( int i = 0; i < 4; i++ ) - { - unsigned char pubkey[33]; - int pklen = 33; - if ( secp256k1_ecdsa_recover_compact( detail::_get_context(), (unsigned char*) hash.data(), - (unsigned char*) result.begin() + 1, - pubkey, &pklen, 1, i ) ) - { - if ( !memcmp( t.begin(), pubkey, sizeof(pubkey) ) ) - { - *result.begin() = 27 + 4 + i; - return result; -// } else { -// printf("Candidate: "); print( pubkey ); printf("\n"); - } - } - } - FC_ASSERT( 0, "Failed to unblind - use different i" ); - } - commitment_type blind( const blind_factor_type& blind, uint64_t value ) { commitment_type result; diff --git a/src/crypto/hex.cpp b/src/crypto/hex.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/md5.cpp b/src/crypto/md5.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/openssl.cpp b/src/crypto/openssl.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/pke.cpp b/src/crypto/pke.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/rand.cpp b/src/crypto/rand.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/ripemd160.cpp b/src/crypto/ripemd160.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/sha1.cpp b/src/crypto/sha1.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/sha224.cpp b/src/crypto/sha224.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp old mode 100644 new mode 100755 diff --git a/src/crypto/sha512.cpp b/src/crypto/sha512.cpp old mode 100644 new mode 100755 diff --git a/src/exception.cpp b/src/exception.cpp old mode 100644 new mode 100755 diff --git a/src/filesystem.cpp b/src/filesystem.cpp old mode 100644 new mode 100755 index a7151c5..3046d56 --- a/src/filesystem.cpp +++ b/src/filesystem.cpp @@ -245,10 +245,16 @@ namespace fc { void remove_all( const path& p ) { boost::filesystem::remove_all(p); } void copy( const path& f, const path& t ) { try { - boost::filesystem::copy( boost::filesystem::path(f), boost::filesystem::path(t) ); + boost::system::error_code ec; + boost::filesystem::copy( boost::filesystem::path(f), boost::filesystem::path(t), ec ); + if( ec ) + { + FC_THROW( "Copy from ${srcfile} to ${dstfile} failed because ${code} : ${message}", + ("srcfile",f)("dstfile",t)("code",ec.value())("message",ec.message()) ); + } } catch ( boost::system::system_error& e ) { FC_THROW( "Copy from ${srcfile} to ${dstfile} failed because ${reason}", - ("srcfile",f)("dstfile",t)("reason",e.what() ) ); + ("srcfile",f)("dstfile",t)("reason",std::string(e.what()) ) ); } catch ( ... ) { FC_THROW( "Copy from ${srcfile} to ${dstfile} failed", ("srcfile",f)("dstfile",t)("inner", fc::except_str() ) ); @@ -262,7 +268,7 @@ namespace fc { catch ( boost::system::system_error& e ) { FC_THROW( "Resize file '${f}' to size ${s} failed: ${reason}", - ("f",f)("s",t)( "reason", e.what() ) ); + ("f",f)("s",t)( "reason", std::string(e.what()) ) ); } catch ( ... ) { @@ -301,13 +307,14 @@ namespace fc { void rename( const path& f, const path& t ) { try { boost::filesystem::rename( boost::filesystem::path(f), boost::filesystem::path(t) ); - } catch ( boost::system::system_error& ) { - try{ - boost::filesystem::copy( boost::filesystem::path(f), boost::filesystem::path(t) ); - boost::filesystem::remove( boost::filesystem::path(f)); - } catch ( boost::system::system_error& e ) { - FC_THROW( "Rename from ${srcfile} to ${dstfile} failed because ${reason}", - ("srcfile",f)("dstfile",t)("reason",e.what() ) ); + } catch ( boost::system::system_error& er ) { + try { + copy( f, t ); + remove( f ); + } catch ( fc::exception& e ) { + FC_RETHROW_EXCEPTION( e, error, + "Rename from ${srcfile} to ${dstfile} failed due to ${reason}, trying to copy then remove", + ("srcfile",f)("dstfile",t)("reason",std::string(er.what())) ); } } catch ( ... ) { FC_THROW( "Rename from ${srcfile} to ${dstfile} failed", diff --git a/src/git_revision.cpp.in b/src/git_revision.cpp.in old mode 100644 new mode 100755 diff --git a/src/interprocess/file_mapping.cpp b/src/interprocess/file_mapping.cpp old mode 100644 new mode 100755 diff --git a/src/interprocess/file_mutex.cpp b/src/interprocess/file_mutex.cpp old mode 100644 new mode 100755 diff --git a/src/interprocess/mmap_struct.cpp b/src/interprocess/mmap_struct.cpp old mode 100644 new mode 100755 diff --git a/src/interprocess/process.cpp b/src/interprocess/process.cpp old mode 100644 new mode 100755 diff --git a/src/interprocess/signals.cpp b/src/interprocess/signals.cpp old mode 100644 new mode 100755 diff --git a/src/io/buffered_iostream.cpp b/src/io/buffered_iostream.cpp old mode 100644 new mode 100755 diff --git a/src/io/console.cpp b/src/io/console.cpp old mode 100644 new mode 100755 diff --git a/src/io/datastream.cpp b/src/io/datastream.cpp old mode 100644 new mode 100755 diff --git a/src/io/fstream.cpp b/src/io/fstream.cpp old mode 100644 new mode 100755 diff --git a/src/io/iostream.cpp b/src/io/iostream.cpp old mode 100644 new mode 100755 diff --git a/src/io/json.cpp b/src/io/json.cpp old mode 100644 new mode 100755 diff --git a/src/io/sstream.cpp b/src/io/sstream.cpp old mode 100644 new mode 100755 diff --git a/src/io/varint.cpp b/src/io/varint.cpp old mode 100644 new mode 100755 diff --git a/src/log/appender.cpp b/src/log/appender.cpp old mode 100644 new mode 100755 diff --git a/src/log/console_appender.cpp b/src/log/console_appender.cpp old mode 100644 new mode 100755 diff --git a/src/log/console_defines.h b/src/log/console_defines.h old mode 100644 new mode 100755 diff --git a/src/log/file_appender.cpp b/src/log/file_appender.cpp old mode 100644 new mode 100755 index 204686a..dabdf3f --- a/src/log/file_appender.cpp +++ b/src/log/file_appender.cpp @@ -12,6 +12,7 @@ #include #include #include +#include namespace fc { diff --git a/src/log/gelf_appender.cpp b/src/log/gelf_appender.cpp old mode 100644 new mode 100755 diff --git a/src/log/log_message.cpp b/src/log/log_message.cpp old mode 100644 new mode 100755 diff --git a/src/log/logger.cpp b/src/log/logger.cpp old mode 100644 new mode 100755 diff --git a/src/log/logger_config.cpp b/src/log/logger_config.cpp old mode 100644 new mode 100755 diff --git a/src/network/http/http_connection.cpp b/src/network/http/http_connection.cpp old mode 100644 new mode 100755 diff --git a/src/network/http/http_server.cpp b/src/network/http/http_server.cpp old mode 100644 new mode 100755 diff --git a/src/network/http/websocket.cpp b/src/network/http/websocket.cpp old mode 100644 new mode 100755 diff --git a/src/network/ip.cpp b/src/network/ip.cpp old mode 100644 new mode 100755 diff --git a/src/network/ntp.cpp b/src/network/ntp.cpp old mode 100644 new mode 100755 diff --git a/src/network/rate_limiting.cpp b/src/network/rate_limiting.cpp old mode 100644 new mode 100755 diff --git a/src/network/resolve.cpp b/src/network/resolve.cpp old mode 100644 new mode 100755 diff --git a/src/network/tcp_socket.cpp b/src/network/tcp_socket.cpp old mode 100644 new mode 100755 index 1c980fc..b40f496 --- a/src/network/tcp_socket.cpp +++ b/src/network/tcp_socket.cpp @@ -177,13 +177,13 @@ namespace fc { keepalive_settings.keepaliveinterval = (ULONG)(interval.count() / fc::milliseconds(1).count()); DWORD dwBytesRet = 0; - if (WSAIoctl(my->_sock.native(), SIO_KEEPALIVE_VALS, &keepalive_settings, sizeof(keepalive_settings), + if (WSAIoctl(my->_sock.native_handle(), SIO_KEEPALIVE_VALS, &keepalive_settings, sizeof(keepalive_settings), NULL, 0, &dwBytesRet, NULL, NULL) == SOCKET_ERROR) wlog("Error setting TCP keepalive values"); #elif !defined(__clang__) || (__clang_major__ >= 6) // This should work for modern Linuxes and for OSX >= Mountain Lion int timeout_sec = interval.count() / fc::seconds(1).count(); - if (setsockopt(my->_sock.native(), IPPROTO_TCP, + if (setsockopt(my->_sock.native_handle(), IPPROTO_TCP, #if defined( __APPLE__ ) TCP_KEEPALIVE, #else @@ -192,7 +192,7 @@ namespace fc { (char*)&timeout_sec, sizeof(timeout_sec)) < 0) wlog("Error setting TCP keepalive idle time"); # if !defined(__APPLE__) || defined(TCP_KEEPINTVL) // TCP_KEEPINTVL not defined before 10.9 - if (setsockopt(my->_sock.native(), IPPROTO_TCP, TCP_KEEPINTVL, + if (setsockopt(my->_sock.native_handle(), IPPROTO_TCP, TCP_KEEPINTVL, (char*)&timeout_sec, sizeof(timeout_sec)) < 0) wlog("Error setting TCP keepalive interval"); # endif // !__APPLE__ || TCP_KEEPINTVL @@ -224,7 +224,7 @@ namespace fc { if (detail::have_so_reuseport) { int reuseport_value = 1; - if (setsockopt(my->_sock.native(), SOL_SOCKET, SO_REUSEPORT, + if (setsockopt(my->_sock.native_handle(), SOL_SOCKET, SO_REUSEPORT, (char*)&reuseport_value, sizeof(reuseport_value)) < 0) { if (errno == ENOPROTOOPT) @@ -291,7 +291,7 @@ namespace fc { if (detail::have_so_reuseport) { int reuseport_value = 1; - if (setsockopt(my->_accept.native(), SOL_SOCKET, SO_REUSEPORT, + if (setsockopt(my->_accept.native_handle(), SOL_SOCKET, SO_REUSEPORT, (char*)&reuseport_value, sizeof(reuseport_value)) < 0) { if (errno == ENOPROTOOPT) diff --git a/src/network/udp_socket.cpp b/src/network/udp_socket.cpp old mode 100644 new mode 100755 diff --git a/src/network/url.cpp b/src/network/url.cpp old mode 100644 new mode 100755 diff --git a/src/real128.cpp b/src/real128.cpp old mode 100644 new mode 100755 diff --git a/src/rpc/bstate.cpp b/src/rpc/bstate.cpp old mode 100644 new mode 100755 diff --git a/src/rpc/cli.cpp b/src/rpc/cli.cpp old mode 100644 new mode 100755 diff --git a/src/rpc/http_api.cpp b/src/rpc/http_api.cpp old mode 100644 new mode 100755 diff --git a/src/rpc/json_connection.cpp b/src/rpc/json_connection.cpp old mode 100644 new mode 100755 diff --git a/src/rpc/state.cpp b/src/rpc/state.cpp old mode 100644 new mode 100755 diff --git a/src/rpc/websocket_api.cpp b/src/rpc/websocket_api.cpp old mode 100644 new mode 100755 diff --git a/src/shared_ptr.cpp b/src/shared_ptr.cpp old mode 100644 new mode 100755 diff --git a/src/string.cpp b/src/string.cpp old mode 100644 new mode 100755 diff --git a/src/thread/context.hpp b/src/thread/context.hpp old mode 100644 new mode 100755 index f6e8a77..18a060c --- a/src/thread/context.hpp +++ b/src/thread/context.hpp @@ -6,7 +6,15 @@ #include -#if BOOST_VERSION >= 105400 +#define BOOST_COROUTINES_NO_DEPRECATION_WARNING // Boost 1.61 +#define BOOST_COROUTINE_NO_DEPRECATION_WARNING // Boost 1.62 + +#if BOOST_VERSION >= 106100 + #include + namespace bc = boost::context::detail; + namespace bco = boost::coroutines; + typedef bco::stack_allocator stack_allocator; +#elif BOOST_VERSION >= 105400 # include namespace bc = boost::context; namespace bco = boost::coroutines; @@ -47,8 +55,13 @@ namespace fc { bco::stack_context stack_ctx; #endif +#if BOOST_VERSION >= 106100 + using context_fn = void (*)(bc::transfer_t); +#else + using context_fn = void(*)(intptr_t); +#endif - context( void (*sf)(intptr_t), stack_allocator& alloc, fc::thread* t ) + context( context_fn sf, stack_allocator& alloc, fc::thread* t ) : caller_context(0), stack_alloc(&alloc), next_blocked(0), diff --git a/src/thread/future.cpp b/src/thread/future.cpp old mode 100644 new mode 100755 diff --git a/src/thread/mutex.cpp b/src/thread/mutex.cpp old mode 100644 new mode 100755 diff --git a/src/thread/non_preemptable_scope_check.cpp b/src/thread/non_preemptable_scope_check.cpp old mode 100644 new mode 100755 diff --git a/src/thread/spin_lock.cpp b/src/thread/spin_lock.cpp old mode 100644 new mode 100755 diff --git a/src/thread/spin_yield_lock.cpp b/src/thread/spin_yield_lock.cpp old mode 100644 new mode 100755 diff --git a/src/thread/task.cpp b/src/thread/task.cpp old mode 100644 new mode 100755 diff --git a/src/thread/thread.cpp b/src/thread/thread.cpp old mode 100644 new mode 100755 diff --git a/src/thread/thread_d.hpp b/src/thread/thread_d.hpp old mode 100644 new mode 100755 index 941b2fa..74b59d3 --- a/src/thread/thread_d.hpp +++ b/src/thread/thread_d.hpp @@ -18,6 +18,7 @@ namespace fc { class thread_d { public: + using context_pair = std::pair; thread_d(fc::thread& s) :self(s), boost_thread(0), task_in_queue(0), @@ -397,7 +398,11 @@ namespace fc { } // slog( "jump to %p from %p", next, prev ); // fc_dlog( logger::get("fc_context"), "from ${from} to ${to}", ( "from", int64_t(prev) )( "to", int64_t(next) ) ); -#if BOOST_VERSION >= 105600 +#if BOOST_VERSION >= 106100 + auto p = context_pair{nullptr, prev}; + auto t = bc::jump_fcontext( next->my_context, &p ); + static_cast(t.data)->second->my_context = t.fctx; +#elif BOOST_VERSION >= 105600 bc::jump_fcontext( &prev->my_context, next->my_context, 0 ); #elif BOOST_VERSION >= 105300 bc::jump_fcontext( prev->my_context, next->my_context, 0 ); @@ -439,7 +444,11 @@ namespace fc { // slog( "jump to %p from %p", next, prev ); // fc_dlog( logger::get("fc_context"), "from ${from} to ${to}", ( "from", int64_t(prev) )( "to", int64_t(next) ) ); -#if BOOST_VERSION >= 105600 +#if BOOST_VERSION >= 106100 + auto p = context_pair{this, prev}; + auto t = bc::jump_fcontext( next->my_context, &p ); + static_cast(t.data)->second->my_context = t.fctx; +#elif BOOST_VERSION >= 105600 bc::jump_fcontext( &prev->my_context, next->my_context, (intptr_t)this ); #elif BOOST_VERSION >= 105300 bc::jump_fcontext( prev->my_context, next->my_context, (intptr_t)this ); @@ -467,9 +476,17 @@ namespace fc { return true; } +#if BOOST_VERSION >= 106100 + static void start_process_tasks( bc::transfer_t my ) + { + auto p = static_cast(my.data); + auto self = static_cast(p->first); + p->second->my_context = my.fctx; +#else static void start_process_tasks( intptr_t my ) { thread_d* self = (thread_d*)my; +#endif try { self->process_tasks(); diff --git a/src/thread/thread_specific.cpp b/src/thread/thread_specific.cpp old mode 100644 new mode 100755 diff --git a/src/time.cpp b/src/time.cpp old mode 100644 new mode 100755 diff --git a/src/uint128.cpp b/src/uint128.cpp old mode 100644 new mode 100755 diff --git a/src/utf8.cpp b/src/utf8.cpp old mode 100644 new mode 100755 diff --git a/src/utf8/ReleaseNotes b/src/utf8/ReleaseNotes old mode 100644 new mode 100755 diff --git a/src/utf8/checked.h b/src/utf8/checked.h old mode 100644 new mode 100755 diff --git a/src/utf8/core.h b/src/utf8/core.h old mode 100644 new mode 100755 diff --git a/src/utf8/unchecked.h b/src/utf8/unchecked.h old mode 100644 new mode 100755 diff --git a/src/utf8/utf8cpp.html b/src/utf8/utf8cpp.html old mode 100644 new mode 100755 diff --git a/src/variant.cpp b/src/variant.cpp old mode 100644 new mode 100755 diff --git a/src/variant_object.cpp b/src/variant_object.cpp old mode 100644 new mode 100755 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt old mode 100644 new mode 100755 index 1043e50..c3f125d --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -23,9 +23,6 @@ target_link_libraries( real128_test fc ) add_executable( hmac_test hmac_test.cpp ) target_link_libraries( hmac_test fc ) -add_executable( blinding_test blinding_test.cpp ) -target_link_libraries( blinding_test fc ) - add_executable( ecc_test crypto/ecc_test.cpp ) target_link_libraries( ecc_test fc ) @@ -51,6 +48,7 @@ add_executable( all_tests all_tests.cpp crypto/sha_tests.cpp network/http/websocket_test.cpp thread/task_cancel.cpp + thread/thread_tests.cpp bloom_test.cpp real128_test.cpp utf8_test.cpp diff --git a/tests/all_tests.cpp b/tests/all_tests.cpp old mode 100644 new mode 100755 diff --git a/tests/api.cpp b/tests/api.cpp old mode 100644 new mode 100755 diff --git a/tests/bip_lock.cpp b/tests/bip_lock.cpp old mode 100644 new mode 100755 diff --git a/tests/blinding_test.cpp b/tests/blinding_test.cpp old mode 100644 new mode 100755 index 318f161..b363ab1 --- a/tests/blinding_test.cpp +++ b/tests/blinding_test.cpp @@ -42,7 +42,7 @@ static fc::string BLIND_T_X = "80deff382af8a8e4a5f297588e44d5bf858f30a524f74b13e static fc::string BLINDED_HASH = "7196e80cdafdfdfb7496323ad24bf47dda8447febd7426e444facc04940c7309"; static fc::string BLIND_SIG = "40d6a477d849cc860df8ad159481f2ffc5b4dc3131b86a799d7d10460824dd53"; static fc::string UNBLINDED = "700092a72a05e33509f9b068aa1d7c5336d8b5692b4157da199d7ec1e10fd7c0"; - +/* BOOST_AUTO_TEST_CASE(test_extended_keys_1) { char seed[16]; @@ -302,3 +302,4 @@ BOOST_AUTO_TEST_CASE(openssl_blinding) // printf("\nunblinded: "); print(sig->s); // printf("\n"); } +*/ \ No newline at end of file diff --git a/tests/bloom_test.cpp b/tests/bloom_test.cpp old mode 100644 new mode 100755 diff --git a/tests/compress/compress.cpp b/tests/compress/compress.cpp old mode 100644 new mode 100755 diff --git a/tests/crypto/aes_test.cpp b/tests/crypto/aes_test.cpp old mode 100644 new mode 100755 diff --git a/tests/crypto/base_n_tests.cpp b/tests/crypto/base_n_tests.cpp old mode 100644 new mode 100755 diff --git a/tests/crypto/bigint_test.cpp b/tests/crypto/bigint_test.cpp old mode 100644 new mode 100755 diff --git a/tests/crypto/blind.cpp b/tests/crypto/blind.cpp old mode 100644 new mode 100755 diff --git a/tests/crypto/blowfish_test.cpp b/tests/crypto/blowfish_test.cpp old mode 100644 new mode 100755 diff --git a/tests/crypto/dh_test.cpp b/tests/crypto/dh_test.cpp old mode 100644 new mode 100755 diff --git a/tests/crypto/ecc_test.cpp b/tests/crypto/ecc_test.cpp old mode 100644 new mode 100755 diff --git a/tests/crypto/log_test.cpp b/tests/crypto/log_test.cpp old mode 100644 new mode 100755 diff --git a/tests/crypto/rand_test.cpp b/tests/crypto/rand_test.cpp old mode 100644 new mode 100755 diff --git a/tests/crypto/sha_tests.cpp b/tests/crypto/sha_tests.cpp old mode 100644 new mode 100755 diff --git a/tests/hmac_test.cpp b/tests/hmac_test.cpp old mode 100644 new mode 100755 diff --git a/tests/network/http/websocket_test.cpp b/tests/network/http/websocket_test.cpp old mode 100644 new mode 100755 diff --git a/tests/rate_limiting.cpp b/tests/rate_limiting.cpp old mode 100644 new mode 100755 diff --git a/tests/real128_test.cpp b/tests/real128_test.cpp old mode 100644 new mode 100755 diff --git a/tests/rpc.cpp b/tests/rpc.cpp old mode 100644 new mode 100755 diff --git a/tests/sleep.cpp b/tests/sleep.cpp old mode 100644 new mode 100755 diff --git a/tests/thread/task_cancel.cpp b/tests/thread/task_cancel.cpp old mode 100644 new mode 100755 diff --git a/tests/thread/thread_tests.cpp b/tests/thread/thread_tests.cpp new file mode 100755 index 0000000..1b7ed8e --- /dev/null +++ b/tests/thread/thread_tests.cpp @@ -0,0 +1,95 @@ +#include + +#include + +using namespace fc; + +BOOST_AUTO_TEST_SUITE(thread_tests) + +BOOST_AUTO_TEST_CASE(executes_task) +{ + bool called = false; + fc::thread thread("my"); + thread.async([&called]{called = true;}).wait(); + BOOST_CHECK(called); +} + +BOOST_AUTO_TEST_CASE(returns_value_from_function) +{ + fc::thread thread("my"); + BOOST_CHECK_EQUAL(10, thread.async([]{return 10;}).wait()); +} + +BOOST_AUTO_TEST_CASE(executes_multiple_tasks) +{ + bool called1 = false; + bool called2 = false; + + fc::thread thread("my"); + auto future1 = thread.async([&called1]{called1 = true;}); + auto future2 = thread.async([&called2]{called2 = true;}); + + future2.wait(); + future1.wait(); + + BOOST_CHECK(called1); + BOOST_CHECK(called2); +} + +BOOST_AUTO_TEST_CASE(calls_tasks_in_order) +{ + std::string result; + + fc::thread thread("my"); + auto future1 = thread.async([&result]{result += "hello ";}); + auto future2 = thread.async([&result]{result += "world";}); + + future2.wait(); + future1.wait(); + + BOOST_CHECK_EQUAL("hello world", result); +} + +BOOST_AUTO_TEST_CASE(yields_execution) +{ + std::string result; + + fc::thread thread("my"); + auto future1 = thread.async([&result]{fc::yield(); result += "world";}); + auto future2 = thread.async([&result]{result += "hello ";}); + + future2.wait(); + future1.wait(); + + BOOST_CHECK_EQUAL("hello world", result); +} + +BOOST_AUTO_TEST_CASE(quits_infinite_loop) +{ + fc::thread thread("my"); + auto f = thread.async([]{while (true) fc::yield();}); + + thread.quit(); + BOOST_CHECK_THROW(f.wait(), fc::canceled_exception); +} + +BOOST_AUTO_TEST_CASE(reschedules_yielded_task) +{ + int reschedule_count = 0; + + fc::thread thread("my"); + auto future = thread.async([&reschedule_count] + { + while (reschedule_count < 10) + { + fc::yield(); + reschedule_count++; + } + }); + + future.wait(); + BOOST_CHECK_EQUAL(10, reschedule_count); +} + +BOOST_AUTO_TEST_SUITE_END() + diff --git a/tests/utf8_test.cpp b/tests/utf8_test.cpp old mode 100644 new mode 100755 diff --git a/vendor/boost_1.51/include/boost/process.hpp b/vendor/boost_1.51/include/boost/process.hpp deleted file mode 100644 index 98e3c89..0000000 --- a/vendor/boost_1.51/include/boost/process.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process.hpp - * - * Convenience header that includes all public Boost.Process header files. - */ - -#ifndef BOOST_PROCESS_HPP -#define BOOST_PROCESS_HPP - -#include - -#endif diff --git a/vendor/boost_1.51/include/boost/process/all.hpp b/vendor/boost_1.51/include/boost/process/all.hpp deleted file mode 100644 index f30e566..0000000 --- a/vendor/boost_1.51/include/boost/process/all.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/all.hpp - * - * Convenience header that includes all public Boost.Process header files. - */ - -#ifndef BOOST_PROCESS_ALL_HPP -#define BOOST_PROCESS_ALL_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif diff --git a/vendor/boost_1.51/include/boost/process/child.hpp b/vendor/boost_1.51/include/boost/process/child.hpp deleted file mode 100644 index 1441e56..0000000 --- a/vendor/boost_1.51/include/boost/process/child.hpp +++ /dev/null @@ -1,100 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/child.hpp - * - * Includes the declaration of the child class. - */ - -#ifndef BOOST_PROCESS_CHILD_HPP -#define BOOST_PROCESS_CHILD_HPP - -#include - -#if defined(BOOST_POSIX_API) -#elif defined(BOOST_WINDOWS_API) -# include -#else -# error "Unsupported platform." -#endif - -#include -#include -#include -#include -#include - -namespace boost { -namespace process { - -/** - * The child class provides access to a child process. - */ -class child : public process -{ -public: - /** - * Creates a new child object that represents the just spawned child - * process \a id. - */ - child(pid_type id, std::map handles) - : process(id), - handles_(handles) - { - } - -#if defined(BOOST_WINDOWS_API) - /** - * Creates a new child object that represents the just spawned child - * process \a id. - * - * This operation is only available on Windows systems. - */ - child(handle hprocess, std::map handles) - : process(hprocess), - handles_(handles) - { - } -#endif - - /** - * Gets a handle to a stream attached to the child. - * - * If the handle doesn't exist an invalid handle is returned. - */ - handle get_handle(stream_id id) const - { - std::map::const_iterator it = handles_.find(id); - return (it != handles_.end()) ? it->second : handle(); - } - -#if defined(BOOST_WINDOWS_API) - handle::native_type get_os_handle() const - { - return handle_.native(); - } -#endif - - -private: - /** - * Handles providing access to streams attached to the child process. - */ - std::map handles_; -}; - -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/config.hpp b/vendor/boost_1.51/include/boost/process/config.hpp deleted file mode 100644 index 7ce15eb..0000000 --- a/vendor/boost_1.51/include/boost/process/config.hpp +++ /dev/null @@ -1,74 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/config.hpp - * - * Defines macros that are used by the library to determine the operating - * system it is running under and the features it supports. - */ - -#ifndef BOOST_PROCESS_CONFIG_HPP -#define BOOST_PROCESS_CONFIG_HPP - -#include -#include -#include -#include - -#if defined(BOOST_POSIX_API) -# include -#elif defined(BOOST_WINDOWS_API) -# include -#endif - -#if defined(BOOST_POSIX_API) || defined(BOOST_PROCESS_DOXYGEN) -# if !defined(BOOST_PROCESS_POSIX_PATH_MAX) || defined(BOOST_PROCESS_DOXYGEN) -/** - * Specifies the system's maximal supported path length. - * - * The macro BOOST_PROCESS_POSIX_PATH_MAX is set to a positive integer - * value which specifies the system's maximal supported path length. It is - * only used if neither PATH_MAX nor _PC_PATH_MAX and HAVE_PATHCONF are defined. - * The maximal supported path length is required by - * boost::process::self::get_work_dir(). Please note that this function is - * also called by the constructor of boost::process::context. - */ -# define BOOST_PROCESS_POSIX_PATH_MAX 259 -# endif -#endif - -/** \cond */ -#define BOOST_PROCESS_SOURCE_LOCATION \ - "in file '" __FILE__ "', line " BOOST_STRINGIZE(__LINE__) ": " - -#if defined(BOOST_POSIX_API) -# define BOOST_PROCESS_LAST_ERROR errno -#elif defined(BOOST_WINDOWS_API) -# define BOOST_PROCESS_LAST_ERROR GetLastError() -#endif - -#define BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR(what) \ - boost::throw_exception(boost::system::system_error( \ - boost::system::error_code(BOOST_PROCESS_LAST_ERROR, \ - boost::system::get_system_category()), \ - BOOST_PROCESS_SOURCE_LOCATION what)) - -#define BOOST_PROCESS_THROW_ERROR(error, what) \ - boost::throw_exception(boost::system::system_error( \ - boost::system::error_code(error, \ - boost::system::get_system_category()), \ - BOOST_PROCESS_SOURCE_LOCATION what)) -/** \endcond */ - -#endif diff --git a/vendor/boost_1.51/include/boost/process/context.hpp b/vendor/boost_1.51/include/boost/process/context.hpp deleted file mode 100644 index 1228d9e..0000000 --- a/vendor/boost_1.51/include/boost/process/context.hpp +++ /dev/null @@ -1,139 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/context.hpp - * - * Includes the declaration of the context class. - */ - -#ifndef BOOST_PROCESS_CONTEXT_HPP -#define BOOST_PROCESS_CONTEXT_HPP - -#include - -#if defined(BOOST_POSIX_API) -# include -#elif defined(BOOST_WINDOWS_API) -# include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace boost { -namespace process { - -/** - * Context class to define how a child process is created. - * - * The context class is used to configure streams, to set the work directory - * and define environment variables. It is also used to change a process - * name (the variable commonly known as argv[0]). - */ -struct context -{ - typedef std::map > - streams_t; - - /** - * Streams. - * - * Streams of a child process can be configured through factory functions - * which return a pair of handles - one handle to use as a stream end - * in the child process and possibly another handle to use as a stream end - * in the parent process (if a pipe is setup both processes can communicate - * with each other). - */ - streams_t streams; - - /** - * Process name. - * - * The child process can access the process name via a variable - * commonly known as argv[0]. - */ - std::string process_name; - - /** - * Work directory. - */ - std::string work_dir; - - /** - * Environment variables. - */ - environment env; - - /** - * Suppress creation of a console window on win32 (nop on other platforms) - */ - bool suppress_console; - - /** - * Constructs a process context. - * - * The default behavior of standard streams is to inherit them. The current - * work directory is also the work directory of the child process. The child - * process also inherits all environment variables. - */ - context() - : work_dir(self::get_work_dir()), - env(self::get_environment()), - suppress_console(false) - { -#if 0 // this default behavior will throw in non-console apps -#if defined(BOOST_POSIX_API) - streams[stdin_id] = behavior::inherit(STDIN_FILENO); - streams[stdout_id] = behavior::inherit(STDOUT_FILENO); - streams[stderr_id] = behavior::inherit(STDERR_FILENO); -#elif defined(BOOST_WINDOWS_API) - streams[stdin_id] = behavior::inherit(GetStdHandle(STD_INPUT_HANDLE)); - streams[stdout_id] = behavior::inherit(GetStdHandle(STD_OUTPUT_HANDLE)); - streams[stderr_id] = behavior::inherit(GetStdHandle(STD_ERROR_HANDLE)); -#endif -#endif - } - -#if defined(BOOST_POSIX_API) || defined(BOOST_PROCESS_DOXYGEN) - /** - * Setups a child process. - * - * This is an extension point to support more configuration options for - * child processes. You can initialize \a setup with a user-defined function - * which is called when a child process is created. - * - * On POSIX platforms setup() is called in the child process. That's why in - * a multithreaded application only async-signal-safe functions must be - * called in the function \a setup is bound to. - * - * On Windows platforms setup() is called in the parent process. A - * reference to a STARTUPINFOA structure is passed as parameter. - */ - boost::function setup; -#elif defined(BOOST_WINDOWS_API) - boost::function setup; -#endif -}; - -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/detail/basic_status.hpp b/vendor/boost_1.51/include/boost/process/detail/basic_status.hpp deleted file mode 100644 index 2da361a..0000000 --- a/vendor/boost_1.51/include/boost/process/detail/basic_status.hpp +++ /dev/null @@ -1,69 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/detail/basic_status.hpp - * - * Includes the declaration of the basic status class. - */ - -#ifndef BOOST_PROCESS_DETAIL_BASIC_STATUS_HPP -#define BOOST_PROCESS_DETAIL_BASIC_STATUS_HPP - -#include -#include -#include - -namespace boost { -namespace process { -namespace detail { - -/** - * The basic_status class to wait for processes to exit. - * - * The basic_status class is a Boost.Asio I/O object and supports synchronous - * and asynchronous wait operations. It must be instantiated with a Service. - */ -template -class basic_status - : public boost::asio::basic_io_object -{ -public: - explicit basic_status(boost::asio::io_service &io_service) - : boost::asio::basic_io_object(io_service) - { - } - - /** - * Waits synchronously for a process to exit. - */ - int wait(pid_type pid) - { - return this->service.wait(this->implementation, pid); - } - - /** - * Waits asynchronously for a process to exit. - */ - template - void async_wait(pid_type pid, Handler handler) - { - this->service.async_wait(this->implementation, pid, handler); - } -}; - -} -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/detail/basic_status_service.hpp b/vendor/boost_1.51/include/boost/process/detail/basic_status_service.hpp deleted file mode 100644 index 2fd1a39..0000000 --- a/vendor/boost_1.51/include/boost/process/detail/basic_status_service.hpp +++ /dev/null @@ -1,323 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/detail/basic_status_service.hpp - * - * Includes the declaration of the basic status service class. - */ - -#ifndef BOOST_PROCESS_DETAIL_BASIC_STATUS_SERVICE_HPP -#define BOOST_PROCESS_DETAIL_BASIC_STATUS_SERVICE_HPP - -#include - -#if defined(BOOST_POSIX_API) -# include -# include -# include -# include -#elif defined(BOOST_WINDOWS_API) -# include -#else -# error "Unsupported platform." -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace boost { -namespace process { -namespace detail { - -/** - * The basic_status_service class provides the service to wait for processes - * synchronously and asynchronously. - */ -template -class basic_status_service - : public boost::asio::detail::service_base -{ -public: - explicit basic_status_service(boost::asio::io_service &io_service) - : boost::asio::detail::service_base(io_service), -#if defined(BOOST_POSIX_API) - interrupt_pid_(-1), - pids_(0) -#elif defined(BOOST_WINDOWS_API) - run_(true) -#endif - { -#if defined(BOOST_WINDOWS_API) - handles_.push_back(CreateEvent(NULL, FALSE, FALSE, NULL)); - if (handles_[0] == NULL) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("CreateEvent() failed"); - work_thread_ = boost::thread( - &basic_status_service::work_thread, this); -#endif - } - - ~basic_status_service() - { -#if defined(BOOST_POSIX_API) - boost::unique_lock lock(work_thread_mutex_); - bool worker_thread_active = (pids_ != 0); - lock.unlock(); - if (worker_thread_active) - { - stop_work_thread(); - work_thread_.join(); - } -#elif defined(BOOST_WINDOWS_API) - stop_work_thread(); - work_thread_.join(); - CloseHandle(handles_[0]); -#endif - } - - typedef boost::shared_ptr implementation_type; - - void construct(implementation_type &impl) - { - impl = boost::make_shared(); - boost::unique_lock lock(work_thread_mutex_); - impls_.push_back(impl); - } - - void destroy(implementation_type &impl) - { - boost::unique_lock lock(work_thread_mutex_); - typename std::vector::iterator it = - std::find(impls_.begin(), impls_.end(), impl); - if (it != impls_.end()) - impls_.erase(it); -#if defined(BOOST_WINDOWS_API) - interrupt_work_thread(); - work_thread_cond_.wait(work_thread_mutex_); - impl->clear(handles_); - work_thread_cond_.notify_all(); -#endif - impl.reset(); - } - - int wait(implementation_type &impl, pid_type pid) - { - boost::system::error_code ec; - int status = impl->wait(pid, ec); -#if defined(BOOST_POSIX_API) - if (ec.value() == ECHILD) - { - boost::unique_lock lock(work_thread_mutex_); - boost::unordered_map::iterator it = statuses_.find(pid); - if (it == statuses_.end()) - { - work_thread_cond_.wait(work_thread_mutex_); - it = statuses_.find(pid); - } - if (it != statuses_.end()) - { - status = it->second; - statuses_.erase(it); - ec.clear(); - } - } -#endif - boost::asio::detail::throw_error(ec); - return status; - } - - template - void async_wait(implementation_type &impl, pid_type pid, Handler handler) - { -#if defined(BOOST_POSIX_API) - boost::unique_lock lock(work_thread_mutex_); - if (++pids_ == 1) - { - // if there was a previous worker thread that exited because - // pids_ dropped to 0, we must join it now to free the thread's - // memory before launching a new worker thread - if (work_thread_.joinable()) - work_thread_.join(); - work_.reset(new boost::asio::io_service::work( - this->get_io_service())); - work_thread_ = boost::thread( - &basic_status_service::work_thread, - this); - } - impl->async_wait(pid, this->get_io_service().wrap(handler)); -#elif defined(BOOST_WINDOWS_API) - HANDLE handle = OpenProcess(SYNCHRONIZE | PROCESS_QUERY_INFORMATION, - FALSE, pid); - if (handle == NULL) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("OpenProcess() failed"); - boost::unique_lock lock(work_thread_mutex_); - if (!work_) - work_.reset(new boost::asio::io_service::work( - this->get_io_service())); - interrupt_work_thread(); - work_thread_cond_.wait(work_thread_mutex_); - handles_.push_back(handle); - impl->async_wait(handle, this->get_io_service().wrap(handler)); - work_thread_cond_.notify_all(); -#endif - } - -private: - void shutdown_service() - { -#if defined(BOOST_WINDOWS_API) - boost::unique_lock lock(work_thread_mutex_); - work_.reset(); -#endif - } - - void work_thread() - { -#if defined(BOOST_POSIX_API) - for (;;) - { - int status; - pid_t pid = ::wait(&status); - if (pid == -1) - { - if (errno != EINTR) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("wait(2) failed"); - } - else if (interrupted(pid)) - { - // On POSIX the only reason to interrupt is to break out. - break; - } - else - { - boost::unique_lock lock(work_thread_mutex_); - bool regchild = false; - for (typename std::vector::iterator it = - impls_.begin(); it != impls_.end(); ++it) - regchild |= (*it)->complete(pid, status); - if (regchild && --pids_ == 0) - { - work_.reset(); - break; - } - else if (!regchild) - { - statuses_.insert(boost::unordered_map:: - value_type(pid, status)); - work_thread_cond_.notify_all(); - } - } - } -#elif defined(BOOST_WINDOWS_API) - for (;;) - { - DWORD res = WaitForMultipleObjects(handles_.size(), &handles_[0], - FALSE, INFINITE); - if (res == WAIT_FAILED) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR( - "WaitForMultipleObjects() failed"); - else if (res - WAIT_OBJECT_0 == 0) - { - boost::unique_lock lock(work_thread_mutex_); - if (!run_) - break; - work_thread_cond_.notify_all(); - work_thread_cond_.wait(work_thread_mutex_); - } - else if (res - WAIT_OBJECT_0 > 0) - { - HANDLE handle = handles_[res - WAIT_OBJECT_0]; - DWORD exit_code; - if (!GetExitCodeProcess(handle, &exit_code)) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR( - "GetExitCodeProcess() failed"); - boost::unique_lock lock(work_thread_mutex_); - for (typename std::vector::iterator it = - impls_.begin(); it != impls_.end(); ++it) - (*it)->complete(handle, exit_code); - std::vector::iterator it = handles_.begin(); - std::advance(it, res - WAIT_OBJECT_0); - handles_.erase(it); - if (handles_.size() == 1) - work_.reset(); - } - } -#endif - } - - void interrupt_work_thread() - { -#if defined(BOOST_POSIX_API) - // By creating a child process which immediately exits - // we interrupt wait(). - std::vector args; - args.push_back("-c"); - args.push_back("'exit'"); - interrupt_pid_ = create_child("/bin/sh", args).get_id(); -#elif defined(BOOST_WINDOWS_API) - // By signaling the event in the first slot WaitForMultipleObjects() - // will return. The work thread won't do anything except checking if - // it should continue to run. - if (!SetEvent(handles_[0])) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("SetEvent() failed"); -#endif - } - -#if defined(BOOST_POSIX_API) - bool interrupted(pid_t pid) - { - boost::mutex::scoped_lock lock(work_thread_mutex_); - return interrupt_pid_ == pid; - } -#endif - - void stop_work_thread() - { - boost::mutex::scoped_lock lock(work_thread_mutex_); -#if defined(BOOST_WINDOWS_API) - // Access to run_ must be sychronized with running(). - run_ = false; -#endif - // Access to interrupt_pid_ must be sychronized with interrupted(). - interrupt_work_thread(); - } - - boost::scoped_ptr work_; - std::vector impls_; - boost::mutex work_thread_mutex_; - boost::thread work_thread_; - boost::condition_variable_any work_thread_cond_; -#if defined(BOOST_POSIX_API) - pid_t interrupt_pid_; - int pids_; - boost::unordered_map statuses_; -#elif defined(BOOST_WINDOWS_API) - bool run_; - std::vector handles_; -#endif -}; - -} -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/detail/posix_helpers.hpp b/vendor/boost_1.51/include/boost/process/detail/posix_helpers.hpp deleted file mode 100644 index 993e2e0..0000000 --- a/vendor/boost_1.51/include/boost/process/detail/posix_helpers.hpp +++ /dev/null @@ -1,106 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/detail/posix_helpers.hpp - * - * Includes the declaration of helper functions for POSIX systems. - */ - -#ifndef BOOST_PROCESS_POSIX_HELPERS_HPP -#define BOOST_PROCESS_POSIX_HELPERS_HPP - -#include -#include -#include -#include -#include -#include - -namespace boost { -namespace process { -namespace detail { - -/** - * Converts an environment to a char** table as used by execve(). - * - * Converts the environment's contents to the format used by the - * execve() system call. The returned char** array is allocated - * in dynamic memory; the caller must free it when not used any - * more. Each entry is also allocated in dynamic memory and is a - * NULL-terminated string of the form var=value; these must also be - * released by the caller. - * - * This operation is only available on POSIX systems. - * - * \return The first argument of the pair is an integer that indicates - * how many strings are stored in the second argument. The - * second argument is a NULL-terminated, dynamically allocated - * array of dynamically allocated strings representing the - * enviroment's content. Each array entry is a NULL-terminated - * string of the form var=value. The caller is responsible for - * freeing them. - */ -inline std::pair environment_to_envp(const environment - &env) -{ - std::size_t nargs = env.size(); - char **envp = new char*[nargs + 1]; - environment::size_type i = 0; - for (environment::const_iterator it = env.begin(); it != env.end(); ++it) - { - std::string s = it->first + "=" + it->second; - envp[i] = new char[s.size() + 1]; - std::strncpy(envp[i], s.c_str(), s.size() + 1); - ++i; - } - envp[i] = 0; - return std::pair(nargs, envp); -} - -/** - * Converts the command line to an array of C strings. - * - * Converts the command line's list of arguments to the format expected - * by the \a argv parameter in the POSIX execve() system call. - * - * This operation is only available on POSIX systems. - * - * \return The first argument of the pair is an integer that indicates - * how many strings are stored in the second argument. The - * second argument is a NULL-terminated, dynamically allocated - * array of dynamically allocated strings holding the arguments - * to the executable. The caller is responsible for freeing them. - */ -template -inline std::pair collection_to_argv(const Arguments &args) -{ - std::size_t nargs = args.size(); - char **argv = new char*[nargs + 1]; - typename Arguments::size_type i = 0; - for (typename Arguments::const_iterator it = args.begin(); it != args.end(); - ++it) - { - argv[i] = new char[it->size() + 1]; - std::strncpy(argv[i], it->c_str(), it->size() + 1); - ++i; - } - argv[nargs] = 0; - return std::pair(nargs, argv); -} - -} -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/detail/status_impl.hpp b/vendor/boost_1.51/include/boost/process/detail/status_impl.hpp deleted file mode 100644 index 618db49..0000000 --- a/vendor/boost_1.51/include/boost/process/detail/status_impl.hpp +++ /dev/null @@ -1,190 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/detail/status_impl.hpp - * - * Includes the declaration of the status implementation class. - */ - -#ifndef BOOST_PROCESS_DETAIL_STATUS_IMPL_HPP -#define BOOST_PROCESS_DETAIL_STATUS_IMPL_HPP - -#include - -#if defined(BOOST_POSIX_API) -# include -# include -# include -# include -#elif defined(BOOST_WINDOWS_API) -# include -#else -# error "Unsupported platform." -#endif - -#include -#include -#include -#include - -namespace boost { -namespace process { -namespace detail { - -#if defined(BOOST_POSIX_API) -typedef pid_t phandle; -#elif defined(BOOST_WINDOWS_API) -typedef HANDLE phandle; -#endif - -struct operation -{ - virtual ~operation(){} - virtual void operator()(int exit_code) - { -#if defined(BOOST_MSVC) - exit_code; -#endif - } -}; - -template -class wrapped_handler : public operation -{ -public: - wrapped_handler(Handler handler) - : handler_(handler) - { - } - - void operator()(int exit_code) - { - handler_(boost::system::error_code(), exit_code); - } - -private: - Handler handler_; -}; - -/** - * The status_impl class saves internal data of every status I/O object. - */ -class status_impl -{ -public: -#if defined(BOOST_WINDOWS_API) - template - void clear(Container &handles) - { - for (operations_type::iterator it = ops_.begin(); it != ops_.end(); - ++it) - { - for (typename Container::iterator it2 = handles.begin(); it2 != - handles.end(); ++it2) - { - if (*it2 == it->first) - { - handles.erase(it2); - break; - } - } - CloseHandle(it->first); - } - } -#endif - - int wait(pid_type pid, boost::system::error_code &ec) - { -#if defined(BOOST_POSIX_API) - pid_t p; - int status; - do - { - p = waitpid(pid, &status, 0); - } while (p == -1 && errno == EINTR); - if (p == -1) - { - ec = boost::system::error_code(errno, - boost::system::get_system_category()); - return -1; - } - return status; -#elif defined(BOOST_WINDOWS_API) - HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION | SYNCHRONIZE, FALSE, - pid); - if (h == NULL) - { - ec = boost::system::error_code(GetLastError(), - boost::system::get_system_category()); - return -1; - } - - if (WaitForSingleObject(h, INFINITE) == WAIT_FAILED) - { - CloseHandle(h); - ec = boost::system::error_code(GetLastError(), - boost::system::get_system_category()); - return -1; - } - - DWORD exit_code; - if (!GetExitCodeProcess(h, &exit_code)) - { - CloseHandle(h); - ec = boost::system::error_code(GetLastError(), - boost::system::get_system_category()); - return -1; - } - if (!CloseHandle(h)) - { - ec = boost::system::error_code(GetLastError(), - boost::system::get_system_category()); - return -1; - } - return exit_code; -#endif - } - - template - void async_wait(phandle ph, Handler handler) - { - ops_.insert(ph, new wrapped_handler(handler)); - } - - bool complete(phandle ph, int exit_code) - { - boost::iterator_range r = - ops_.equal_range(ph); - if (r.empty()) - return false; - for (operations_type::iterator it = r.begin(); it != r.end(); ++it) - (*it->second)(exit_code); - ops_.erase(r.begin(), r.end()); -#if defined(BOOST_WINDOWS_API) - if (!CloseHandle(ph)) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("CloseHandle() failed"); -#endif - return true; - } - -private: - typedef boost::ptr_unordered_multimap operations_type; - operations_type ops_; -}; - -} -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/detail/systembuf.hpp b/vendor/boost_1.51/include/boost/process/detail/systembuf.hpp deleted file mode 100644 index d6dce50..0000000 --- a/vendor/boost_1.51/include/boost/process/detail/systembuf.hpp +++ /dev/null @@ -1,228 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/detail/systembuf.hpp - * - * Includes the declaration of the systembuf class. - */ - -#ifndef BOOST_PROCESS_DETAIL_SYSTEMBUF_HPP -#define BOOST_PROCESS_DETAIL_SYSTEMBUF_HPP - -#include - -#if defined(BOOST_POSIX_API) -# include -# include -#elif defined(BOOST_WINDOWS_API) -# include -#else -# error "Unsupported platform." -#endif - -#include -#include -#include -#include -#include - -namespace boost { -namespace process { - -class postream; - -namespace detail { - -/** - * std::streambuf implementation for handles. - * - * systembuf provides a std::streambuf implementation for handles. - * Contrarywise to the handle class, this class does \b not take - * ownership of the native handle; this should be taken care of - * somewhere else. - * - * This class follows the expected semantics of a std::streambuf object. - * However, it is not copyable to avoid introducing inconsistences with - * the on-disk file and the in-memory buffers. - */ -class systembuf : public std::streambuf, public boost::noncopyable -{ - friend class boost::process::postream; - -public: -#if defined(BOOST_PROCESS_DOXYGEN) - /** - * Opaque name for the native handle type. - */ - typedef NativeHandleType handle_type; -#elif defined(BOOST_POSIX_API) - typedef int handle_type; -#elif defined(BOOST_WINDOWS_API) - typedef HANDLE handle_type; -#endif - - /** - * Constructs a new systembuf for the given handle. - * - * This constructor creates a new systembuf object that reads or - * writes data from/to the \a h native handle. This handle - * is \b not owned by the created systembuf object; the code - * should take care of it externally. - * - * This class buffers input and output; the buffer size may be - * tuned through the \a bufsize parameter, which defaults to 8192 - * bytes. - * - * \see pistream and postream - */ - explicit systembuf(handle_type h, std::size_t bufsize = 8192) - : handle_(h), - bufsize_(bufsize), - read_buf_(new char[bufsize]), - write_buf_(new char[bufsize]) - { -#if defined(BOOST_POSIX_API) - BOOST_ASSERT(handle_ >= 0); -#elif defined(BOOST_WINDOWS_API) - BOOST_ASSERT(handle_ != INVALID_HANDLE_VALUE); -#endif - BOOST_ASSERT(bufsize_ > 0); - setp(write_buf_.get(), write_buf_.get() + bufsize_); - } - -protected: - /** - * Reads new data from the native handle. - * - * This operation is called by input methods when there is no more - * data in the input buffer. The function fills the buffer with new - * data, if available. - * - * \pre All input positions are exhausted (gptr() >= egptr()). - * \post The input buffer has new data, if available. - * \returns traits_type::eof() if a read error occurrs or there are - * no more data to be read. Otherwise returns - * traits_type::to_int_type(*gptr()). - */ - virtual int_type underflow() - { - BOOST_ASSERT(gptr() >= egptr()); - - bool ok; -#if defined(BOOST_POSIX_API) - ssize_t cnt = read(handle_, read_buf_.get(), bufsize_); - ok = (cnt != -1 && cnt != 0); -#elif defined(BOOST_WINDOWS_API) - DWORD cnt; - BOOL res = ReadFile(handle_, read_buf_.get(), bufsize_, &cnt, NULL); - ok = (res && cnt > 0); -#endif - - if (!ok) - return traits_type::eof(); - else - { - setg(read_buf_.get(), read_buf_.get(), read_buf_.get() + cnt); - return traits_type::to_int_type(*gptr()); - } - } - - /** - * Makes room in the write buffer for additional data. - * - * This operation is called by output methods when there is no more - * space in the output buffer to hold a new element. The function - * first flushes the buffer's contents to disk and then clears it to - * leave room for more characters. The given \a c character is - * stored at the beginning of the new space. - * - * \pre All output positions are exhausted (pptr() >= epptr()). - * \post The output buffer has more space if no errors occurred - * during the write to disk. - * \post *(pptr() - 1) is \a c. - * \returns traits_type::eof() if a write error occurrs. Otherwise - * returns traits_type::not_eof(c). - */ - virtual int_type overflow(int c) - { - BOOST_ASSERT(pptr() >= epptr()); - - if (sync() == -1) - return traits_type::eof(); - - if (!traits_type::eq_int_type(c, traits_type::eof())) - { - traits_type::assign(*pptr(), static_cast( - c)); - pbump(1); - } - - return traits_type::not_eof(c); - } - - /** - * Flushes the output buffer to disk. - * - * Synchronizes the systembuf buffers with the contents of the file - * associated to this object through the native handle. The output buffer - * is flushed to disk and cleared to leave new room for more data. - * - * \returns 0 on success, -1 if an error occurred. - */ - virtual int sync() - { -#if defined(BOOST_POSIX_API) - ssize_t cnt = pptr() - pbase(); - bool ok = (write(handle_, pbase(), cnt) == cnt); - if (ok) - pbump(-cnt); - return ok ? 0 : -1; -#elif defined(BOOST_WINDOWS_API) - long cnt = pptr() - pbase(); - DWORD rcnt; - BOOL res = WriteFile(handle_, pbase(), cnt, &rcnt, NULL); - bool ok = (res && static_cast(rcnt) == cnt); - if (ok) - pbump(-cnt); - return ok ? 0 : -1; -#endif - } - -private: - /** - * Native handle used by the systembuf object. - */ - handle_type handle_; - - /** - * Internal buffer size used during read and write operations. - */ - std::size_t bufsize_; - - /** - * Internal buffer used during read operations. - */ - boost::scoped_array read_buf_; - - /** - * Internal buffer used during write operations. - */ - boost::scoped_array write_buf_; -}; - -} -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/detail/windows_helpers.hpp b/vendor/boost_1.51/include/boost/process/detail/windows_helpers.hpp deleted file mode 100644 index 5656aaa..0000000 --- a/vendor/boost_1.51/include/boost/process/detail/windows_helpers.hpp +++ /dev/null @@ -1,138 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/detail/windows_helpers.hpp - * - * Includes the declaration of helper functions for Windows systems. - */ - -#ifndef BOOST_PROCESS_WINDOWS_HELPERS_HPP -#define BOOST_PROCESS_WINDOWS_HELPERS_HPP - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace boost { -namespace process { -namespace detail { - -/** - * Converts an environment to a string used by CreateProcess(). - * - * Converts the environment's contents to the format used by the - * CreateProcess() system call. The returned char* string is - * allocated in dynamic memory; the caller must free it when not - * used any more. This is enforced by the use of a shared pointer. - * - * This operation is only available on Windows systems. - * - * \return A dynamically allocated char* string that represents - * the environment's content. This string is of the form - * var1=value1\\0var2=value2\\0\\0. - */ -inline boost::shared_array environment_to_windows_strings(environment - &env) -{ - boost::shared_array envp; - - if (env.empty()) - { - envp.reset(new char[2]); - ZeroMemory(envp.get(), 2); - } - else - { - std::string s; - for (environment::const_iterator it = env.begin(); it != env.end(); - ++it) - { - s += it->first + "=" + it->second; - s.push_back(0); - } - envp.reset(new char[s.size() + 1]); -#if (BOOST_MSVC >= 1400) - memcpy_s(envp.get(), s.size() + 1, s.c_str(), s.size() + 1); -#else - memcpy(envp.get(), s.c_str(), s.size() + 1); -#endif - } - - return envp; -} - -/** - * Converts the command line to a plain string. - * - * Converts the command line's list of arguments to the format expected by the - * \a lpCommandLine parameter in the CreateProcess() system call. - * - * This operation is only available on Windows systems. - * - * \return A dynamically allocated string holding the command line - * to be passed to the executable. It is returned in a - * shared_array object to ensure its release at some point. - */ -template -inline boost::shared_array collection_to_windows_cmdline(const Arguments - &args) -{ - typedef std::vector arguments_t; - arguments_t args2; - typename Arguments::size_type i = 0; - std::size_t size = 0; - for (typename Arguments::const_iterator it = args.begin(); it != args.end(); - ++it) - { - std::string arg = *it; - - std::string::size_type pos = 0; - while ( (pos = arg.find('"', pos)) != std::string::npos) - { - arg.replace(pos, 1, "\\\""); - pos += 2; - } - - if (arg.find(' ') != std::string::npos) - arg = '\"' + arg + '\"'; - - if (i++ != args.size() - 1) - arg += ' '; - - args2.push_back(arg); - size += arg.size() + 1; - } - - boost::shared_array cmdline(new char[size]); - cmdline.get()[0] = '\0'; - for (arguments_t::size_type i = 0; i < args.size(); ++i) -#if (BOOST_MSVC >= 1400) - strcat_s(cmdline.get(), size, args2[i].c_str()); -#else - strncat(cmdline.get(), args2[i].c_str(), args2[i].size()); -#endif - - return cmdline; -} - -} -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/environment.hpp b/vendor/boost_1.51/include/boost/process/environment.hpp deleted file mode 100644 index daf44e3..0000000 --- a/vendor/boost_1.51/include/boost/process/environment.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/environment.hpp - * - * Includes the declaration of the environment class. - */ - -#ifndef BOOST_PROCESS_ENVIRONMENT_HPP -#define BOOST_PROCESS_ENVIRONMENT_HPP - -#include -#include - -namespace boost { -namespace process { - -/** - * Representation of a process' environment variables. - * - * The environment is a map that establishes an unidirectional - * association between variable names and their values and is - * represented by a string to string map. - * - * Variables may be defined to the empty string. Be aware that doing so - * is not portable: POSIX systems will treat such variables as being - * defined to the empty value, but Windows systems are not able to - * distinguish them from undefined variables. - * - * Neither POSIX nor Windows systems support a variable with no name. - * - * It is worthy to note that the environment is sorted alphabetically. - * This is provided for-free by the map container used to implement this - * type, and this behavior is required by Windows systems. - */ -typedef std::map environment; - -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/handle.hpp b/vendor/boost_1.51/include/boost/process/handle.hpp deleted file mode 100644 index b880a3e..0000000 --- a/vendor/boost_1.51/include/boost/process/handle.hpp +++ /dev/null @@ -1,231 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/handle.hpp - * - * Includes the declaration of the handle class. - */ - -#ifndef BOOST_PROCESS_HANDLE_HPP -#define BOOST_PROCESS_HANDLE_HPP - -#include - -#if defined(BOOST_POSIX_API) -# include -#elif defined(BOOST_WINDOWS_API) -# include -#else -# error "Unsupported platform." -#endif - -#include -#include - -namespace boost { -namespace process { - -/** - * RAII model for handles. - * - * The \a handle class is a RAII model for native handles. This class wraps - * one of such handles grabbing its ownership, and automaticaly closes it - * upon destruction. It is used to avoid leaking open handles, shall an - * unexpected execution trace occur. - */ -class handle -{ -public: -#if defined(BOOST_PROCESS_DOXYGEN) - /** - * Opaque name for the native handle type. - * - * On POSIX systems \a NativeSystemHandle is an integer type while it is - * a \a HANDLE on Windows systems. - */ - typedef NativeSystemHandle native_type; -#elif defined(BOOST_POSIX_API) - typedef int native_type; -#elif defined(BOOST_WINDOWS_API) - typedef HANDLE native_type; -#endif - - /** - * Constructs an invalid handle. - * - * \see valid() - */ - handle() - { - } - - /** - * RAII settings to specify if handle should be automatically closed. - */ - enum close_type { do_close, dont_close }; - - /** - * Constructs a handle from a native handle. - * - * This constructor creates a new \a handle object that takes - * ownership of the given \a native handle. If \a close is set to - * handle::dont_close the \a native handle is not closed upon destruction. - * The user must not close \a native if it is owned by a \a handle object. - * Ownership can be reclaimed using release(). - * - * \see release() - */ - handle(native_type native, close_type close = handle::do_close) - : impl_(boost::make_shared(native, close)) - { - } - - /** - * Checks whether the handle is valid or not. - * - * \return true if the handle is valid; false otherwise. - */ - bool valid() const - { - return impl_ && impl_->valid(); - } - - /** - * Closes the handle. - * - * \post The handle is invalid. - * \post The native handle is closed. - */ - void close() - { - if (impl_) - impl_->close(); - } - - /** - * Gets the native handle. - * - * The caller can issue any operation on it except closing it. - * If closing is required, release() shall be used. - * - * \return The native handle. - */ - native_type native() const - { - return impl_ ? impl_->native() : invalid_handle(); - } - - /** - * Reclaims ownership of the native handle. - * - * The caller is responsible of closing the native handle. - * - * \post The handle is invalid. - * \return The native handle. - */ - native_type release() - { - return impl_ ? impl_->release() : invalid_handle(); - } - -private: - class impl - { - public: - typedef handle::native_type native_type; - - impl(native_type native, close_type close) - : native_(native), - close_(close) - { - } - - ~impl() - { - if (valid() && close_ == handle::do_close) - { -#if defined(BOOST_POSIX_API) - ::close(native_); -#elif defined(BOOST_WINDOWS_API) - CloseHandle(native_); -#endif - } - } - - bool valid() const - { - return native_ != handle::invalid_handle(); - } - - void close() - { - if (valid()) - { -#if defined(BOOST_POSIX_API) - ::close(native_); -#elif defined(BOOST_WINDOWS_API) - CloseHandle(native_); -#endif - native_ = handle::invalid_handle(); - } - } - - native_type native() const - { - return native_; - } - - native_type release() - { - native_type native = native_; - native_ = handle::invalid_handle(); - return native; - } - - private: - native_type native_; - close_type close_; - }; - - /** - * Implementation of handle to store native handle value. - * - * A shared pointer is used as handles represent system resources. If a - * handle is closed and becomes invalid the state of copies of the handle - * object will be updated as they all share the handle implementation. - */ - boost::shared_ptr impl_; - - /** - * Constant function representing an invalid handle value. - * - * Returns the platform-specific handle value that represents an - * invalid handle. This is a constant function rather than a regular - * constant because, in the latter case, we cannot define it under - * Windows due to the value being of a complex type. - */ - static const native_type invalid_handle() - { -#if defined(BOOST_POSIX_API) - return -1; -#elif defined(BOOST_WINDOWS_API) - return INVALID_HANDLE_VALUE; -#endif - } -}; - -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/operations.hpp b/vendor/boost_1.51/include/boost/process/operations.hpp deleted file mode 100644 index 1d6da12..0000000 --- a/vendor/boost_1.51/include/boost/process/operations.hpp +++ /dev/null @@ -1,439 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/operations.hpp - * - * Provides miscellaneous free functions. - */ - -#ifndef BOOST_PROCESS_OPERATIONS_HPP -#define BOOST_PROCESS_OPERATIONS_HPP - -#include - -#if defined(BOOST_POSIX_API) -# include -# include -# include -# include -# include -# include -# if defined(__CYGWIN__) -# include -# include -# endif -#elif defined(BOOST_WINDOWS_API) -# include -# include -# include -# include -#else -# error "Unsupported platform." -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace boost { -namespace process { - -/** - * Locates the executable program \a file in all the directory components - * specified in \a path. If \a path is empty, the value of the PATH - * environment variable is used. - * - * The path variable is interpreted following the same conventions used - * to parse the PATH environment variable in the underlying platform. - * - * \throw boost::filesystem::filesystem_error If the file cannot be found - * in the path. - */ -inline std::string find_executable_in_path(const std::string &file, - std::string path = "") -{ -#if defined(BOOST_POSIX_API) - BOOST_ASSERT(file.find('/') == std::string::npos); -#elif defined(BOOST_WINDOWS_API) - BOOST_ASSERT(file.find_first_of("\\/") == std::string::npos); -#endif - - std::string result; - -#if defined(BOOST_POSIX_API) - if (path.empty()) - { - const char *envpath = getenv("PATH"); - if (!envpath) - boost::throw_exception(boost::filesystem::filesystem_error( - BOOST_PROCESS_SOURCE_LOCATION "file not found", file, - boost::system::errc::make_error_code( - boost::system::errc::no_such_file_or_directory))); - path = envpath; - } - BOOST_ASSERT(!path.empty()); - -#if defined(__CYGWIN__) - if (!cygwin_posix_path_list_p(path.c_str())) - { - int size = cygwin_win32_to_posix_path_list_buf_size(path.c_str()); - boost::scoped_array cygpath(new char[size]); - cygwin_win32_to_posix_path_list(path.c_str(), cygpath.get()); - path = cygpath.get(); - } -#endif - - std::string::size_type pos1 = 0, pos2; - do - { - pos2 = path.find(':', pos1); - std::string dir = (pos2 != std::string::npos) ? - path.substr(pos1, pos2 - pos1) : path.substr(pos1); - std::string f = dir + - (boost::algorithm::ends_with(dir, "/") ? "" : "/") + file; - if (!access(f.c_str(), X_OK)) - result = f; - pos1 = pos2 + 1; - } while (pos2 != std::string::npos && result.empty()); -#elif defined(BOOST_WINDOWS_API) - const char *exts[] = { "", ".exe", ".com", ".bat", NULL }; - const char **ext = exts; - while (*ext) - { - char buf[MAX_PATH]; - char *dummy; - DWORD size = SearchPathA(path.empty() ? NULL : path.c_str(), - file.c_str(), *ext, MAX_PATH, buf, &dummy); - BOOST_ASSERT(size < MAX_PATH); - if (size > 0) - { - result = buf; - break; - } - ++ext; - } -#endif - - if (result.empty()) - boost::throw_exception(boost::filesystem::filesystem_error( - BOOST_PROCESS_SOURCE_LOCATION "file not found", file, - boost::system::errc::make_error_code( - boost::system::errc::no_such_file_or_directory))); - - return result; -} - -/** - * Extracts the program name from a given executable. - * - * \return The program name. On Windows the program name - * is returned without a file extension. - */ -inline std::string executable_to_progname(const std::string &exe) -{ - std::string::size_type begin = 0; - std::string::size_type end = std::string::npos; - -#if defined(BOOST_POSIX_API) - std::string::size_type slash = exe.rfind('/'); -#elif defined(BOOST_WINDOWS_API) - std::string::size_type slash = exe.find_last_of("/\\"); -#endif - if (slash != std::string::npos) - begin = slash + 1; - -#if defined(BOOST_WINDOWS_API) - if (exe.size() > 4 && (boost::algorithm::iends_with(exe, ".exe") || - boost::algorithm::iends_with(exe, ".com") || - boost::algorithm::iends_with(exe, ".bat"))) - end = exe.size() - 4; -#endif - - return exe.substr(begin, end - begin); -} - -/** - * Starts a new child process. - * - * Launches a new process based on the binary image specified by the - * executable, the set of arguments passed to it and the execution context. - * - * \remark Blocking remarks: This function may block if the device holding the - * executable blocks when loading the image. This might happen if, e.g., - * the binary is being loaded from a network share. - * - * \return A handle to the new child process. - */ -template -inline child create_child(const std::string &executable, Arguments args, - Context ctx) -{ - typedef std::map handles_t; - handles_t handles; - typename Context::streams_t::iterator it = ctx.streams.begin(); - for (; it != ctx.streams.end(); ++it) - { - if (it->first == stdin_id) - handles[it->first] = it->second(input_stream); - else if (it->first == stdout_id) - handles[it->first] = it->second(output_stream); - else if (it->first == stderr_id) - handles[it->first] = it->second(output_stream); -#if defined(BOOST_POSIX_API) - else - handles[it->first] = it->second(unknown_stream); -#endif - } - - std::string p_name = ctx.process_name.empty() ? - executable_to_progname(executable) : ctx.process_name; - args.insert(args.begin(), p_name); - -#if defined(BOOST_POSIX_API) - // Between fork() and execve() only async-signal-safe functions - // must be called if multithreaded applications should be supported. - // That's why the following code is executed before fork() is called. -#if defined(F_MAXFD) - int maxdescs = fcntl(-1, F_MAXFD, 0); - if (maxdescs == -1) - maxdescs = sysconf(_SC_OPEN_MAX); -#else - int maxdescs = sysconf(_SC_OPEN_MAX); -#endif - if (maxdescs == -1) - maxdescs = 1024; - std::vector closeflags(maxdescs, true); - std::pair argv = detail::collection_to_argv(args); - std::pair envp = - detail::environment_to_envp(ctx.env); - - const char *work_dir = ctx.work_dir.c_str(); - - pid_t pid = fork(); - if (pid == -1) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("fork(2) failed"); - else if (pid == 0) - { - if (chdir(work_dir) == -1) - { - auto r = write(STDERR_FILENO, "chdir() failed\n", 15); - if( r || !r ) _exit(127); - } - - for (handles_t::iterator it = handles.begin(); it != handles.end(); - ++it) - { - if (it->second.child.valid()) - { - handles_t::iterator it2 = it; - ++it2; - for (; it2 != handles.end(); ++it2) - { - if (it2->second.child.native() == it->first) - { - int fd = fcntl(it2->second.child.native(), F_DUPFD, - it->first + 1); - if (fd == -1) - { - auto r = write(STDERR_FILENO, "chdir() failed\n", 15); - (void)r; - _exit(127); - } - it2->second.child = fd; - } - } - - if (dup2(it->second.child.native(), it->first) == -1) - { - auto r = write(STDERR_FILENO, "chdir() failed\n", 15); - if( r || !r ) _exit(127); - } - closeflags[it->first] = false; - } - } - - if (ctx.setup) - ctx.setup(); - - for (std::size_t i = 0; i < closeflags.size(); ++i) - { - if (closeflags[i]) - close(i); - } - - execve(executable.c_str(), argv.second, envp.second); - - // Actually we should delete argv and envp data. As we must not - // call any non-async-signal-safe functions though we simply exit. - auto r = write(STDERR_FILENO, "execve() failed\n", 16); - if( r || !r ) _exit(127); - _exit(127); - } - else - { - BOOST_ASSERT(pid > 0); - - for (std::size_t i = 0; i < argv.first; ++i) - delete[] argv.second[i]; - delete[] argv.second; - - for (std::size_t i = 0; i < envp.first; ++i) - delete[] envp.second[i]; - delete[] envp.second; - - std::map parent_ends; - for (handles_t::iterator it = handles.begin(); it != handles.end(); - ++it) - parent_ends[it->first] = it->second.parent; - - return child(pid, parent_ends); - } -#elif defined(BOOST_WINDOWS_API) - STARTUPINFOA startup_info; - ZeroMemory(&startup_info, sizeof(startup_info)); - startup_info.cb = sizeof(startup_info); - startup_info.dwFlags |= STARTF_USESTDHANDLES; - startup_info.hStdInput = handles[stdin_id].child.native(); - startup_info.hStdOutput = handles[stdout_id].child.native(); - startup_info.hStdError = handles[stderr_id].child.native(); - - if (ctx.setup) - ctx.setup(startup_info); - - PROCESS_INFORMATION pi; - ZeroMemory(&pi, sizeof(pi)); - - boost::shared_array cmdline = - detail::collection_to_windows_cmdline(args); - - boost::scoped_array exe(new char[executable.size() + 1]); -#if (BOOST_MSVC >= 1400) - strcpy_s(exe.get(), executable.size() + 1, executable.c_str()); -#else - strcpy(exe.get(), executable.c_str()); -#endif - - boost::scoped_array workdir(new char[ctx.work_dir.size() + 1]); -#if (BOOST_MSVC >= 1400) - strcpy_s(workdir.get(), ctx.work_dir.size() + 1, ctx.work_dir.c_str()); -#else - strcpy(workdir.get(), ctx.work_dir.c_str()); -#endif - - boost::shared_array envstrs = - detail::environment_to_windows_strings(ctx.env); - - DWORD creation_flags = 0; - if (ctx.suppress_console) - creation_flags |= CREATE_NO_WINDOW; - - if (CreateProcessA(exe.get(), cmdline.get(), NULL, NULL, TRUE, creation_flags, - envstrs.get(), workdir.get(), &startup_info, &pi) == 0) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("CreateProcess() failed"); - - handle hprocess(pi.hProcess); - - if (!CloseHandle(pi.hThread)) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("CloseHandle() failed"); - - std::map parent_ends; - parent_ends[stdin_id] = handles[stdin_id].parent; - parent_ends[stdout_id] = handles[stdout_id].parent; - parent_ends[stderr_id] = handles[stderr_id].parent; - - return child(hprocess, parent_ends); -#endif -} - -/** - * \overload - */ -inline child create_child(const std::string &executable) -{ - return create_child(executable, std::vector(), context()); -} - -/** - * \overload - */ -template -inline child create_child(const std::string &executable, Arguments args) -{ - return create_child(executable, args, context()); -} - -/** - * Starts a shell-based command. - * - * Executes the given command through the default system shell. The - * command is subject to pattern expansion, redirection and pipelining. - * The shell is launched as described by the parameters in the context. - * - * This function behaves similarly to the system(3) system call. In a - * POSIX system, the command is fed to /bin/sh whereas under a Windows - * system, it is fed to cmd.exe. It is difficult to write portable - * commands, but this function comes in handy in multiple situations. - * - * \remark Blocking remarks: This function may block if the device holding the - * executable blocks when loading the image. This might happen if, e.g., - * the binary is being loaded from a network share. - * - * \return A handle to the new child process. - */ -template -inline child shell(const std::string &command, Context ctx) -{ -#if defined(BOOST_POSIX_API) - std::string executable = "/bin/sh"; - std::vector args; - args.push_back("-c"); - args.push_back(command); -#elif defined(BOOST_WINDOWS_API) - char sysdir[MAX_PATH]; - UINT size = GetSystemDirectoryA(sysdir, sizeof(sysdir)); - if (!size) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("GetSystemDirectory() failed"); - std::string executable = std::string(sysdir) + - (sysdir[size - 1] != '\\' ? "\\cmd.exe" : "cmd.exe"); - std::vector args; - args.push_back("/c"); - args.push_back(command); -#endif - return create_child(executable, args, ctx); -} - -/** - * \overload - */ -inline child shell(const std::string &command) -{ - return shell(command, context()); -} - -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/pid_type.hpp b/vendor/boost_1.51/include/boost/process/pid_type.hpp deleted file mode 100644 index 49dc51e..0000000 --- a/vendor/boost_1.51/include/boost/process/pid_type.hpp +++ /dev/null @@ -1,56 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/pid_type.hpp - * - * Includes the declaration of the pid type. - */ - -#ifndef BOOST_PROCESS_PID_TYPE_HPP -#define BOOST_PROCESS_PID_TYPE_HPP - -#include - -#if defined(BOOST_POSIX_API) -# include -#elif defined(BOOST_WINDOWS_API) -# include -#endif - -namespace boost { -namespace process { - -#if defined(BOOST_PROCESS_DOXYGEN) -/** - * Opaque name for the process identifier type. - * - * Each operating system identifies processes using a specific type. - * The \a pid_type type is used to transparently refer to a process - * regardless of the operating system. - * - * This type is guaranteed to be an integral type on all supported - * platforms. On POSIX systems it is defined as pid_t, on Windows systems as - * DWORD. - */ -typedef NativeProcessId pid_type; -#elif defined(BOOST_POSIX_API) -typedef pid_t pid_type; -#elif defined(BOOST_WINDOWS_API) -typedef DWORD pid_type; -#endif - -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/pipe.hpp b/vendor/boost_1.51/include/boost/process/pipe.hpp deleted file mode 100644 index 23eb0a8..0000000 --- a/vendor/boost_1.51/include/boost/process/pipe.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/pipe.hpp - * - * Includes the declaration of the pipe class. - */ - -#ifndef BOOST_PROCESS_PIPE_HPP -#define BOOST_PROCESS_PIPE_HPP - -#include -#include - -namespace boost { -namespace process { - -#if defined(BOOST_PROCESS_DOXYGEN) -/** - * The pipe class is a type definition for stream-based classes defined by - * Boost.Asio. - * - * The type definition is provided for convenience. You can also use Boost.Asio - * classes directly for asynchronous I/O operations. - */ -typedef BoostAsioPipe pipe; -#elif defined(BOOST_POSIX_API) -typedef boost::asio::posix::stream_descriptor pipe; -#elif defined(BOOST_WINDOWS_API) -typedef boost::asio::windows::stream_handle pipe; -#else -# error "Unsupported platform." -#endif - -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/pistream.hpp b/vendor/boost_1.51/include/boost/process/pistream.hpp deleted file mode 100644 index 9bb252f..0000000 --- a/vendor/boost_1.51/include/boost/process/pistream.hpp +++ /dev/null @@ -1,114 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/pistream.hpp - * - * Includes the declaration of the pistream class. - */ - -#ifndef BOOST_PROCESS_PISTREAM_HPP -#define BOOST_PROCESS_PISTREAM_HPP - -#include -#include -#include -#include - -namespace boost { -namespace process { - -/** - * Child process' output stream. - * - * The pistream class represents an output communication channel with the - * child process. The child process writes data to this stream and the - * parent process can read it through the pistream object. In other - * words, from the child's point of view, the communication channel is an - * output one, but from the parent's point of view it is an input one; - * hence the confusing pistream name. - * - * pistream objects cannot be copied because they buffer data - * that flows through the communication channel. - * - * A pistream object behaves as a std::istream stream in all senses. - * The class is only provided because it must provide a method to let - * the caller explicitly close the communication channel. - * - * \remark Blocking remarks: Functions that read data from this - * stream can block if the associated handle blocks during - * the read. As this class is used to communicate with child - * processes through anonymous pipes, the most typical blocking - * condition happens when the child has no more data to send to - * the pipe's system buffer. When this happens, the buffer - * eventually empties and the system blocks until the writer - * generates some data. - */ -class pistream : public std::istream, public boost::noncopyable -{ -public: - /** - * Creates a new process' output stream. - */ - explicit pistream(boost::process::handle h) - : std::istream(0), - handle_(h), - systembuf_(handle_.native()) - { - rdbuf(&systembuf_); - } - - /** - * Returns the handle managed by this stream. - */ - const boost::process::handle &handle() const - { - return handle_; - } - - /** - * Returns the handle managed by this stream. - */ - boost::process::handle &handle() - { - return handle_; - } - - /** - * Closes the handle managed by this stream. - * - * Explicitly closes the handle managed by this stream. This - * function can be used by the user to tell the child process it's - * not willing to receive more data. - */ - void close() - { - handle_.close(); - } - -private: - /** - * The handle managed by this stream. - */ - boost::process::handle handle_; - - /** - * The systembuf object used to manage this stream's data. - */ - detail::systembuf systembuf_; -}; - -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/postream.hpp b/vendor/boost_1.51/include/boost/process/postream.hpp deleted file mode 100644 index 23c34a9..0000000 --- a/vendor/boost_1.51/include/boost/process/postream.hpp +++ /dev/null @@ -1,115 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/postream.hpp - * - * Includes the declaration of the postream class. - */ - -#ifndef BOOST_PROCESS_POSTREAM_HPP -#define BOOST_PROCESS_POSTREAM_HPP - -#include -#include -#include -#include - -namespace boost { -namespace process { - -/** - * Child process' input stream. - * - * The postream class represents an input communication channel with the - * child process. The child process reads data from this stream and the - * parent process can write to it through the postream object. In other - * words, from the child's point of view, the communication channel is an - * input one, but from the parent's point of view it is an output one; - * hence the confusing postream name. - * - * postream objects cannot be copied because they buffer data that flows - * through the communication channel. - * - * A postream object behaves as a std::ostream stream in all senses. - * The class is only provided because it must provide a method to let - * the caller explicitly close the communication channel. - * - * \remark Blocking remarks: Functions that write data to this - * stream can block if the associated handle blocks during - * the write. As this class is used to communicate with child - * processes through anonymous pipes, the most typical blocking - * condition happens when the child is not processing the data - * in the pipe's system buffer. When this happens, the buffer - * eventually fills up and the system blocks until the reader - * consumes some data, leaving some new room. - */ -class postream : public std::ostream, public boost::noncopyable -{ -public: - /** - * Creates a new process' input stream. - */ - explicit postream(boost::process::handle h) - : std::ostream(0), - handle_(h), - systembuf_(handle_.native()) - { - rdbuf(&systembuf_); - } - - /** - * Returns the handle managed by this stream. - */ - const boost::process::handle &handle() const - { - return handle_; - } - - /** - * Returns the handle managed by this stream. - */ - boost::process::handle &handle() - { - return handle_; - } - - /** - * Closes the handle managed by this stream. - * - * Explicitly closes the handle managed by this stream. This - * function can be used by the user to tell the child process there - * is no more data to send. - */ - void close() - { - systembuf_.sync(); - handle_.close(); - } - -private: - /** - * The handle managed by this stream. - */ - boost::process::handle handle_; - - /** - * The systembuf object used to manage this stream's data. - */ - detail::systembuf systembuf_; -}; - -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/process.hpp b/vendor/boost_1.51/include/boost/process/process.hpp deleted file mode 100644 index e0e2149..0000000 --- a/vendor/boost_1.51/include/boost/process/process.hpp +++ /dev/null @@ -1,213 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/process.hpp - * - * Includes the declaration of the process class. - */ - -#ifndef BOOST_PROCESS_PROCESS_HPP -#define BOOST_PROCESS_PROCESS_HPP - -#include - -#if defined(BOOST_POSIX_API) -# include -# include -# include -# include -# include -#elif defined(BOOST_WINDOWS_API) -# include -# include -# include -#else -# error "Unsupported platform." -#endif - -#include - -namespace boost { -namespace process { - -/** - * Process class to represent any running process. - */ -class process -{ -public: - /** - * Constructs a new process object. - * - * Creates a new process object that represents a running process - * within the system. - * - * On Windows the process is opened and a handle saved. This is required - * to avoid the operating system removing process resources when the - * process exits. The handle is closed when the process instance (and all - * of its copies) is destroyed. - */ - process(pid_type id) - : id_(id) -#if defined(BOOST_WINDOWS_API) - , handle_(open_process(id)) -#endif - { - } - -#if defined(BOOST_WINDOWS_API) || defined(BOOST_PROCESS_DOXYGEN) - /** - * Constructs a new process object. - * - * Creates a new process object that represents a running process - * within the system. - * - * This operation is only available on Windows systems. The handle is - * closed when the process instance (and all of its copies) is destroyed. - */ - process(handle h) - : id_(GetProcessId(h.native())), - handle_(h) - { - } -#endif - - /** - * Returns the process identifier. - */ - pid_type get_id() const - { - return id_; - } - - /** - * Terminates the process execution. - * - * Forces the termination of the process execution. Some platforms - * allow processes to ignore some external termination notifications - * or to capture them for a proper exit cleanup. You can set the - * \a force flag to true to force their termination regardless - * of any exit handler. - * - * After this call, accessing this object can be dangerous because the - * process identifier may have been reused by a different process. It - * might still be valid, though, if the process has refused to die. - * - * \throw boost::system::system_error If system calls used to terminate the - * process fail. - */ - void terminate(bool force = false) const - { -#if defined(BOOST_POSIX_API) - if (kill(id_, force ? SIGKILL : SIGTERM) == -1) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("kill(2) failed"); -#elif defined(BOOST_WINDOWS_API) -#if defined(BOOST_MSVC) - force; -#endif - HANDLE h = OpenProcess(PROCESS_TERMINATE, FALSE, id_); - if (h == NULL) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("OpenProcess() failed"); - if (!TerminateProcess(h, EXIT_FAILURE)) - { - CloseHandle(h); - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("TerminateProcess() failed"); - } - if (!CloseHandle(h)) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("CloseHandle() failed"); -#endif - } - - /** - * Blocks and waits for the process to terminate. - * - * Returns an exit code. The process object ceases to be valid after this - * call. - * - * \remark Blocking remarks: This call blocks if the process has not - * finalized execution and waits until it terminates. - * - * \throw boost::system::system_error If system calls used to wait for the - * process fail. - */ - int wait() const - { -#if defined(BOOST_POSIX_API) - pid_t p; - int status; - do - { - p = waitpid(id_, &status, 0); - } while (p == -1 && errno == EINTR); - if (p == -1) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("waitpid(2) failed"); - return status; -#elif defined(BOOST_WINDOWS_API) - HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION | SYNCHRONIZE, FALSE, - id_); - if (h == NULL) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("OpenProcess() failed"); - if (WaitForSingleObject(h, INFINITE) == WAIT_FAILED) - { - CloseHandle(h); - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR( - "WaitForSingleObject() failed"); - } - DWORD exit_code; - if (!GetExitCodeProcess(h, &exit_code)) - { - CloseHandle(h); - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR( - "GetExitCodeProcess() failed"); - } - if (!CloseHandle(h)) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("CloseHandle() failed"); - return exit_code; -#endif - } - -private: - /** - * The process identifier. - */ - pid_type id_; - -#if defined(BOOST_WINDOWS_API) - /** - * Opens a process and returns a handle. - * - * OpenProcess() returns NULL and not INVALID_HANDLE_VALUE on failure. - * That's why the return value is manually checked in this helper function - * instead of simply passing it to the constructor of the handle class. - */ - HANDLE open_process(pid_type id) - { - HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, id); - if (h == NULL) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("OpenProcess() failed"); - return h; - } -protected: - /** - * The process handle. - */ - handle handle_; -private: -#endif -}; - -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/self.hpp b/vendor/boost_1.51/include/boost/process/self.hpp deleted file mode 100644 index 704501c..0000000 --- a/vendor/boost_1.51/include/boost/process/self.hpp +++ /dev/null @@ -1,188 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/self.hpp - * - * Includes the declaration of the self class. - */ - -#ifndef BOOST_PROCESS_SELF_HPP -#define BOOST_PROCESS_SELF_HPP - -#include - -#if defined(BOOST_POSIX_API) -# include -# include -# include -# include -# if defined(__APPLE__) -# include -# endif -#elif defined(BOOST_WINDOWS_API) -# include -#else -# error "Unsupported platform." -#endif - -#include -#include -#include -#include -#include - -#if defined(BOOST_POSIX_API) -extern "C" -{ - extern char **environ; -} -#endif - -namespace boost { -namespace process { - -/** - * The self class provides access to the process itself. - */ -class self : public process, public boost::noncopyable -{ -public: - /** - * Returns the self instance representing the caller's process. - */ - static self &get_instance() - { - static self *instance = 0; - if (!instance) - instance = new self; - return *instance; - } - - /** - * Returns the current environment. - * - * Returns the current process environment variables. Modifying the - * returned object has no effect on the current environment. - */ - static environment get_environment() - { - environment e; - -#if defined(BOOST_POSIX_API) -# if defined(__APPLE__) - char **env = *_NSGetEnviron(); -# else - char **env = environ; -# endif - - while (*env) - { - std::string s = *env; - std::string::size_type pos = s.find('='); - e.insert(environment::value_type(s.substr(0, pos), - s.substr(pos + 1))); - ++env; - } -#elif defined(BOOST_WINDOWS_API) -# ifdef GetEnvironmentStrings -# undef GetEnvironmentStrings -# endif - - char *ms_environ = GetEnvironmentStrings(); - if (!ms_environ) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR( - "GetEnvironmentStrings() failed"); - try - { - char *env = ms_environ; - while (*env) - { - std::string s = env; - std::string::size_type pos = s.find('='); - e.insert(environment::value_type(s.substr(0, pos), - s.substr(pos + 1))); - env += s.size() + 1; - } - } - catch (...) - { - FreeEnvironmentStringsA(ms_environ); - throw; - } - FreeEnvironmentStringsA(ms_environ); -#endif - - return e; - } - - /** - * Returns the current work directory. - */ - static std::string get_work_dir() - { -#if defined(BOOST_POSIX_API) -#if defined(PATH_MAX) - char buffer[PATH_MAX]; - char *cwd = buffer; - long size = PATH_MAX; -#elif defined(_PC_PATH_MAX) - errno = 0; - long size = pathconf("/", _PC_PATH_MAX); - if (size == -1 && errno) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("pathconf(2) failed"); - else if (size == -1) - size = BOOST_PROCESS_POSIX_PATH_MAX; - BOOST_ASSERT(size > 0); - boost::scoped_array buffer(new char[size]); - char *cwd = buffer.get(); -#else - char buffer[BOOST_PROCESS_POSIX_PATH_MAX]; - char *cwd = buffer; - long size = BOOST_PROCESS_POSIX_PATH_MAX; -#endif - if (!getcwd(cwd, size)) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("getcwd(2) failed"); - BOOST_ASSERT(cwd[0] != '\0'); - return cwd; -#elif defined(BOOST_WINDOWS_API) - BOOST_ASSERT(MAX_PATH > 0); - char cwd[MAX_PATH]; - if (!GetCurrentDirectoryA(sizeof(cwd), cwd)) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR( - "GetCurrentDirectory() failed"); - BOOST_ASSERT(cwd[0] != '\0'); - return cwd; -#endif - } - -private: - /** - * Constructs a new self object. - * - * Creates a new self object that represents the current process. - */ - self() : -#if defined(BOOST_POSIX_API) - process(getpid()) -#elif defined(BOOST_WINDOWS_API) - process(GetCurrentProcessId()) -#endif - { - } -}; - -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/status.hpp b/vendor/boost_1.51/include/boost/process/status.hpp deleted file mode 100644 index 55b89f3..0000000 --- a/vendor/boost_1.51/include/boost/process/status.hpp +++ /dev/null @@ -1,41 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/status.hpp - * - * Includes the declaration of the status class. - */ - -#ifndef BOOST_PROCESS_STATUS_HPP -#define BOOST_PROCESS_STATUS_HPP - -#include -#include -#include - -namespace boost { -namespace process { - -/** - * The status class to wait for processes to exit. - * - * The status class is a Boost.Asio I/O object and supports synchronous - * and asynchronous wait operations. - */ -typedef detail::basic_status > status; - -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/stream_behavior.hpp b/vendor/boost_1.51/include/boost/process/stream_behavior.hpp deleted file mode 100644 index 2911f56..0000000 --- a/vendor/boost_1.51/include/boost/process/stream_behavior.hpp +++ /dev/null @@ -1,326 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/stream_behavior.hpp - * - * Includes the declaration of stream behavior classes. - */ - -#ifndef BOOST_PROCESS_STREAM_BEHAVIOR_HPP -#define BOOST_PROCESS_STREAM_BEHAVIOR_HPP - -#include - -#if defined(BOOST_POSIX_API) -# include -# include -# include -#elif defined(BOOST_WINDOWS_API) -# include -# include -#endif - -#include -#include -#include -#include -#include - -namespace boost { -namespace process { -namespace behavior { - -/** - * Stream behavior to close streams of a child process. - * - * A child process will not be able to use the stream. - */ -class close -{ -public: - stream_ends operator()(stream_type) const - { - return stream_ends(); - } -}; - -/** - * Stream behavior to make a child process inherit streams. - * - * A child process will use the very same stream of its parent process. - */ -class inherit -{ -public: - inherit(handle::native_type h) - : h_(h, handle::dont_close) - { -#if defined(BOOST_WINDOWS_API) - if (h != INVALID_HANDLE_VALUE) - { - if (!SetHandleInformation(h_.native(), HANDLE_FLAG_INHERIT, - HANDLE_FLAG_INHERIT)) - { - HANDLE proc = GetCurrentProcess(); - HANDLE dup; - if (!DuplicateHandle(proc, h_.native(), proc, &dup, 0, - TRUE, DUPLICATE_SAME_ACCESS)) - { - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR( - "DuplicateHandle() failed"); - } - h_ = dup; - } - } -#endif - } - - stream_ends operator()(stream_type) const - { - return stream_ends(h_, handle()); - } - -private: - handle h_; -}; - -/** - * Stream behavior to redirect streams with a pipe. - * - * A child process will be able to communicate with its parent process. - */ -class pipe -{ -public: -#if defined(BOOST_POSIX_API) - pipe() - : stype_(unknown_stream) - { - } - - pipe(stream_type stype) - : stype_(stype) - { - } -#endif - - stream_ends operator()(stream_type stype) const - { - handle::native_type ends[2]; -#if defined(BOOST_POSIX_API) - if (::pipe(ends) == -1) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("pipe(2) failed"); - if (stype_ != unknown_stream) - stype = stype_; -#elif defined(BOOST_WINDOWS_API) - SECURITY_ATTRIBUTES sa; - ZeroMemory(&sa, sizeof(sa)); - sa.nLength = sizeof(sa); - sa.lpSecurityDescriptor = NULL; - sa.bInheritHandle = FALSE; - if (!CreatePipe(&ends[0], &ends[1], &sa, 0)) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("CreatePipe() failed"); -#endif - handle child_end = ends[stype == input_stream ? 0 : 1]; - handle parent_end = ends[stype == input_stream ? 1 : 0]; -#if defined(BOOST_WINDOWS_API) - if (!SetHandleInformation(child_end.native(), HANDLE_FLAG_INHERIT, - HANDLE_FLAG_INHERIT)) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR( - "SetHandleInformation() failed"); -#endif - return stream_ends(child_end, parent_end); - } - -#if defined(BOOST_POSIX_API) -private: - stream_type stype_; -#endif -}; - -/** - * Stream behavior to redirect streams with a named pipe. - * - * A child process will be able to communicate with its parent process. - */ -class named_pipe -{ -public: - named_pipe(const std::string &name) - : name_(name) -#if defined(BOOST_POSIX_API) - , stype_(unknown_stream) -#endif - { - } - -#if defined(BOOST_POSIX_API) - named_pipe(const std::string &name, stream_type stype) - : name_(name), - stype_(stype) - { - } -#endif - - stream_ends operator()(stream_type stype) const - { -#if defined(BOOST_POSIX_API) - if (mkfifo(name_.c_str(), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) == -1) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("mkfifo(3) failed"); - handle child_end = open(name_.c_str(), O_RDONLY | O_NONBLOCK); - if (!child_end.valid()) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("open(2) failed"); - int opts = fcntl(child_end.native(), F_GETFL); - if (opts == -1) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("fcntl(2) failed"); - opts ^= O_NONBLOCK; - if (fcntl(child_end.native(), F_SETFL, opts) == -1) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("fcntl(2) failed"); - handle parent_end = open(name_.c_str(), O_WRONLY); - if (!parent_end.valid()) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("open(2) failed"); - if (stype_ != unknown_stream) - stype = stype_; -#elif defined(BOOST_WINDOWS_API) - SECURITY_ATTRIBUTES sa; - ZeroMemory(&sa, sizeof(sa)); - sa.nLength = sizeof(sa); - sa.lpSecurityDescriptor = NULL; - sa.bInheritHandle = TRUE; - handle child_end = CreateNamedPipeA(name_.c_str(), PIPE_ACCESS_INBOUND | - FILE_FLAG_OVERLAPPED, 0, 1, 8192, 8192, 0, &sa); - if (!child_end.valid()) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("CreateNamedPipe() failed"); - handle parent_end = CreateFileA(name_.c_str(), GENERIC_WRITE, 0, NULL, - OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); - if (!parent_end.valid()) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("CreateFile() failed"); -#endif - if (stype == output_stream) - std::swap(child_end, parent_end); -#if defined(BOOST_WINDOWS_API) - if (!SetHandleInformation(child_end.native(), HANDLE_FLAG_INHERIT, - HANDLE_FLAG_INHERIT)) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR( - "SetHandleInformation() failed"); -#endif - return stream_ends(child_end, parent_end); - } - -private: - std::string name_; - -#if defined(BOOST_POSIX_API) - stream_type stype_; -#endif -}; - -/** - * Stream behavior to redirect streams with a pipe which supports asynchronous - * I/O. - * - * As platforms require different types of pipes for asynchronous I/O this - * stream behavior is provided for convenience. It uses the minimum required - * pipe type on a platform in order to be able to use asynchronous I/O. - */ -#if defined(BOOST_POSIX_API) || defined(BOOST_PROCESS_DOXYGEN) -typedef pipe async_pipe; -#elif defined(BOOST_WINDOWS_API) -class async_pipe -{ -public: - stream_ends operator()(stream_type stype) const - { - UUID uuid; - RPC_STATUS s = UuidCreateSequential(&uuid); - if (s != RPC_S_OK && s != RPC_S_UUID_LOCAL_ONLY) - BOOST_PROCESS_THROW_ERROR(s, "UuidCreateSequential() failed"); - unsigned char *c; - s = UuidToStringA(&uuid, &c); - if (s != RPC_S_OK) - BOOST_PROCESS_THROW_ERROR(s, "UuidToString() failed"); - std::string name; - try - { - name = reinterpret_cast(c); - } - catch (...) - { - RpcStringFreeA(&c); - throw; - } - RpcStringFreeA(&c); - named_pipe p("\\\\.\\pipe\\boost_process_" + name); - return p(stype); - } -}; -#endif - -/** - * Stream behavior to mute streams. - * - * A child process will be able to use streams. But data written to an - * output stream is discarded and data read from an input stream is 0. - */ -class null -{ -public: -#if defined(BOOST_POSIX_API) - null() - : stype_(unknown_stream) - { - } - - null(stream_type stype) - : stype_(stype) - { - } -#endif - - stream_ends operator()(stream_type stype) const - { -#if defined(BOOST_POSIX_API) - if (stype_ != unknown_stream) - stype = stype_; - std::string filename = (stype == input_stream) ? "/dev/zero" : - "/dev/null"; - int flag = (stype == input_stream) ? O_RDONLY : O_WRONLY; - handle child_end = open(filename.c_str(), flag); - if (!child_end.valid()) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("open(2) failed"); -#elif defined(BOOST_WINDOWS_API) - DWORD access = (stype == input_stream) ? GENERIC_READ : GENERIC_WRITE; - handle child_end = CreateFileA("NUL", access, 0, NULL, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL); - if (!child_end.valid()) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("CreateFile() failed"); - if (!SetHandleInformation(child_end.native(), HANDLE_FLAG_INHERIT, - HANDLE_FLAG_INHERIT)) - BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR( - "SetHandleInformation() failed"); -#endif - return stream_ends(child_end, handle()); - } - -#if defined(BOOST_POSIX_API) -private: - stream_type stype_; -#endif -}; - -} -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/stream_ends.hpp b/vendor/boost_1.51/include/boost/process/stream_ends.hpp deleted file mode 100644 index 2ae87a1..0000000 --- a/vendor/boost_1.51/include/boost/process/stream_ends.hpp +++ /dev/null @@ -1,68 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/stream_ends.hpp - * - * Includes the declaration of the stream_ends class. - */ - -#ifndef BOOST_PROCESS_STREAM_ENDS_HPP -#define BOOST_PROCESS_STREAM_ENDS_HPP - -#include -#include - -namespace boost { -namespace process { - -/** - * A pair of handles to configure streams. - * - * Stream behaviors return a pair of handles to specify how a child's stream - * should be configured and possibly the opposite end of a child's end. This - * is the end remaining in the parent process and which can be used for example - * to communicate with a child process through its standard streams. - */ -struct stream_ends { - /** - * The child's end. - */ - handle child; - - /** - * The parent's end. - */ - handle parent; - - /** - * Standard constructor creating two invalid handles. - */ - stream_ends() - { - } - - /** - * Helper constructor to easily initialize handles. - */ - stream_ends(handle c, handle p) - : child(c), - parent(p) - { - } -}; - -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/stream_id.hpp b/vendor/boost_1.51/include/boost/process/stream_id.hpp deleted file mode 100644 index cb098c7..0000000 --- a/vendor/boost_1.51/include/boost/process/stream_id.hpp +++ /dev/null @@ -1,50 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/stream_id.hpp - * - * Includes the declaration of the stream_id type. - */ - -#ifndef BOOST_PROCESS_STREAM_ID_HPP -#define BOOST_PROCESS_STREAM_ID_HPP - -#include - -namespace boost { -namespace process { - -/** - * Standard stream id to refer to standard streams in a cross-platform manner. - */ -enum std_stream_id { stdin_id, stdout_id, stderr_id }; - -#if defined(BOOST_PROCESS_DOXYGEN) -/** - * Stream id type. - * - * Depending on the platform the stream id type is defined to refer to standard - * streams only or to support more streams. - */ -typedef NativeStreamId stream_id; -#elif defined(BOOST_POSIX_API) -typedef int stream_id; -#elif defined(BOOST_WINDOWS_API) -typedef std_stream_id stream_id; -#endif - -} -} - -#endif diff --git a/vendor/boost_1.51/include/boost/process/stream_type.hpp b/vendor/boost_1.51/include/boost/process/stream_type.hpp deleted file mode 100644 index d78c1f9..0000000 --- a/vendor/boost_1.51/include/boost/process/stream_type.hpp +++ /dev/null @@ -1,45 +0,0 @@ -// -// Boost.Process -// ~~~~~~~~~~~~~ -// -// Copyright (c) 2006, 2007 Julio M. Merino Vidal -// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling -// Copyright (c) 2009 Boris Schaeling -// Copyright (c) 2010 Felipe Tanus, Boris Schaeling -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -/** - * \file boost/process/stream_type.hpp - * - * Includes the declaration of the stream_type enumeration. - */ - -#ifndef BOOST_PROCESS_STREAM_TYPE_HPP -#define BOOST_PROCESS_STREAM_TYPE_HPP - -#include - -namespace boost { -namespace process { - -/** - * Stream type to differentiate between input and output streams. - * - * On POSIX systems another value unknown_stream is defined. It is passed - * to stream behaviors for file descriptors greater than 2. - */ -enum stream_type { - input_stream, - output_stream -#if defined(BOOST_POSIX_API) - , unknown_stream -#endif -}; - -} -} - -#endif diff --git a/vendor/boost_1.51/libs/context/asm/fcontext_arm_aapcs_elf_gas.S b/vendor/boost_1.51/libs/context/asm/fcontext_arm_aapcs_elf_gas.S deleted file mode 100644 index 7724441..0000000 --- a/vendor/boost_1.51/libs/context/asm/fcontext_arm_aapcs_elf_gas.S +++ /dev/null @@ -1,101 +0,0 @@ -/* - Copyright Oliver Kowalke 2009. - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or copy at - http://www.boost.org/LICENSE_1_0.txt) -*/ - -/******************************************************************* - * * - * ------------------------------------------------------------- * - * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | * - * ------------------------------------------------------------- * - * | 0x0 | 0x4 | 0x8 | 0xc | 0x10| 0x14| 0x18| 0x1c| 0x20| 0x24| * - * ------------------------------------------------------------- * - * | v1 | v2 | v3 | v4 | v5 | v6 | v7 | v8 | sp | lr | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 10 | | * - * ------------------------------------------------------------- * - * | 0x28| | * - * ------------------------------------------------------------- * - * | pc | | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 11 | 12 | | * - * ------------------------------------------------------------- * - * | 0x2c| 0x30| | * - * ------------------------------------------------------------- * - * |sbase|slimit| | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | * - * ------------------------------------------------------------- * - * | 0x34| 0x38|0x3c| 0x40| 0x44| 0x48| 0x4c| 0x50| 0x54| 0x58 | * - * ------------------------------------------------------------- * - * | s16 | s17 | s18 | s19 | s20 | s21 | s22 | s23 | s24 | s25 | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 23 | 24 | 25 | 26 | 27 | 28 | | * - * ------------------------------------------------------------- * - * | 0x5c| 0x60| 0x64| 0x68| 0x6c| 0x70| | * - * ------------------------------------------------------------- * - * | s26 | s27 | s28 | s29 | s30 | s31 | | * - * ------------------------------------------------------------- * - * * - * *****************************************************************/ - -.text -.globl jump_fcontext -.align 2 -.type jump_fcontext,%function -jump_fcontext: - stmia a1, {v1-v8,sp-lr} @ save V1-V8,SP-LR - str lr, [a1,#40] @ save LR as PC - -#if (defined(__VFP_FP__) && !defined(__SOFTFP__)) - cmp a4, #0 @ test if fpu env should be preserved - beq 1f - - mov a4, a1 - add a4, #52 - fstmiax a4, {d8-d15} @ save S16-S31 - - mov a4, a2 - add a4, #52 - fldmiax a4, {d8-d15} @ restore S16-S31 -1: -#endif - - mov a1, a3 @ use third arg as return value after jump - @ and as first arg in context function - ldmia a2, {v1-v8,sp-pc} @ restore v1-V8,SP-PC -.size jump_fcontext,.-jump_fcontext - -.text -.globl make_fcontext -.align 2 -.type make_fcontext,%function -make_fcontext: - str a1, [a1,#0] @ save the address of passed context - str a2, [a1,#40] @ save address of the context function - ldr a2, [a1,#44] @ load the stack base - - push {a1,lr} @ save pointer to fcontext_t - mov a1, a2 @ stack pointer as arg for align_stack - bl align_stack@PLT @ align stack - mov a2, a1 @ begin of aligned stack - pop {a1,lr} @ restore pointer to fcontext_t - - str a2, [a1,#32] @ save the aligned stack base - - adr a2, finish @ address of finish; called after context function returns - str a2, [a1,#36] - - mov a1, #0 - bx lr - -finish: - mov a1, #0 @ exit code is zero - bl _exit@PLT @ exit application -.size make_fcontext,.-make_fcontext diff --git a/vendor/boost_1.51/libs/context/asm/fcontext_i386_ms_pe_masm.asm b/vendor/boost_1.51/libs/context/asm/fcontext_i386_ms_pe_masm.asm deleted file mode 100644 index 0f4dd67..0000000 --- a/vendor/boost_1.51/libs/context/asm/fcontext_i386_ms_pe_masm.asm +++ /dev/null @@ -1,151 +0,0 @@ - -; Copyright Oliver Kowalke 2009. -; Distributed under the Boost Software License, Version 1.0. -; (See accompanying file LICENSE_1_0.txt or copy at -; http://www.boost.org/LICENSE_1_0.txt) - -; -------------------------------------------------------------- -; | 0 | 1 | 2 | 3 | 4 | 5 | -; -------------------------------------------------------------- -; | 0h | 04h | 08h | 0ch | 010h | 014h | -; -------------------------------------------------------------- -; | EDI | ESI | EBX | EBP | ESP | EIP | -; -------------------------------------------------------------- -; -------------------------------------------------------------- -; | 6 | 7 | | -; -------------------------------------------------------------- -; | 018h | 01ch | | -; -------------------------------------------------------------- -; | ss_base | ss_limit| | -; -------------------------------------------------------------- -; -------------------------------------------------------------- -; | 8 | | -; -------------------------------------------------------------- -; | 020h | | -; -------------------------------------------------------------- -; |fc_execpt| | -; -------------------------------------------------------------- -; -------------------------------------------------------------- -; | 9 | | -; -------------------------------------------------------------- -; | 024h | | -; -------------------------------------------------------------- -; |fc_strage| | -; -------------------------------------------------------------- -; -------------------------------------------------------------- -; | 10 | 11 | | -; -------------------------------------------------------------- -; | 028h | 02ch | | -; -------------------------------------------------------------- -; | fc_mxcsr|fc_x87_cw| | -; -------------------------------------------------------------- - -.386 -.XMM -.model flat, c -_exit PROTO, value:SDWORD -align_stack PROTO, vp:DWORD -seh_fcontext PROTO, except:DWORD, frame:DWORD, context:DWORD, dispatch:DWORD -.code - -jump_fcontext PROC EXPORT - mov ecx, [esp+04h] ; load address of the first fcontext_t arg - mov [ecx], edi ; save EDI - mov [ecx+04h], esi ; save ESI - mov [ecx+08h], ebx ; save EBX - mov [ecx+0ch], ebp ; save EBP - - assume fs:nothing - mov edx, fs:[018h] ; load NT_TIB - assume fs:error - mov eax, [edx] ; load current SEH exception list - mov [ecx+020h], eax ; save current exception list - mov eax, [edx+04h] ; load current stack base - mov [ecx+018h], eax ; save current stack base - mov eax, [edx+08h] ; load current stack limit - mov [ecx+01ch], eax ; save current stack limit - mov eax, [edx+010h] ; load fiber local storage - mov [ecx+024h], eax ; save fiber local storage - - lea eax, [esp+04h] ; exclude the return address - mov [ecx+010h], eax ; save as stack pointer - mov eax, [esp] ; load return address - mov [ecx+014h], eax ; save return address - - mov edx, [esp+08h] ; load address of the second fcontext_t arg - mov edi, [edx] ; restore EDI - mov esi, [edx+04h] ; restore ESI - mov ebx, [edx+08h] ; restore EBX - mov ebp, [edx+0ch] ; restore EBP - - mov eax, [esp+010h] ; check if fpu enve preserving was requested - test eax, eax - je nxt - - stmxcsr [ecx+028h] ; save MMX control word - fnstcw [ecx+02ch] ; save x87 control word - ldmxcsr [edx+028h] ; restore MMX control word - fldcw [edx+02ch] ; restore x87 control word -nxt: - mov ecx, edx - assume fs:nothing - mov edx, fs:[018h] ; load NT_TIB - assume fs:error - mov eax, [ecx+020h] ; load SEH exception list - mov [edx], eax ; restore next SEH item - mov eax, [ecx+018h] ; load stack base - mov [edx+04h], eax ; restore stack base - mov eax, [ecx+01ch] ; load stack limit - mov [edx+08h], eax ; restore stack limit - mov eax, [ecx+024h] ; load fiber local storage - mov [edx+010h], eax ; restore fiber local storage - - mov eax, [esp+0ch] ; use third arg as return value after jump - - mov esp, [ecx+010h] ; restore ESP - mov [esp+04h], eax ; use third arg as first arg in context function - mov ecx, [ecx+014h] ; fetch the address to return to - - jmp ecx ; indirect jump to context -jump_fcontext ENDP - -make_fcontext PROC EXPORT - mov eax, [esp+04h] ; load address of the fcontext_t arg0 - mov [eax], eax ; save the address of passed context - mov ecx, [esp+08h] ; load the address of the context function - mov [eax+014h], ecx ; save the address of the context function - mov edx, [eax+018h] ; load the stack base - - push eax ; save pointer to fcontext_t - push edx ; stack pointer as arg for align_stack - call align_stack ; align stack - mov edx, eax ; begin of aligned stack - pop eax ; remove arg for align_stack - pop eax ; restore pointer to fcontext_t - - lea edx, [edx-014h] ; reserve space for last frame on stack, (ESP + 4) & 15 == 0 - mov [eax+010h], edx ; save the aligned stack - - mov ecx, seh_fcontext ; set ECX to exception-handler - mov [edx+0ch], ecx ; save ECX as SEH handler - mov ecx, 0ffffffffh ; set ECX to -1 - mov [edx+08h], ecx ; save ECX as next SEH item - lea ecx, [edx+08h] ; load address of next SEH item - mov [eax+02ch], ecx ; save next SEH - - stmxcsr [eax+028h] ; save MMX control word - fnstcw [eax+02ch] ; save x87 control word - - mov ecx, finish ; address of finish - mov [edx], ecx - - xor eax, eax - ret - -finish: - xor eax, eax - push eax ; exit code is zero - call _exit ; exit application - hlt -make_fcontext ENDP -END diff --git a/vendor/boost_1.51/libs/context/asm/fcontext_i386_sysv_elf_gas.S b/vendor/boost_1.51/libs/context/asm/fcontext_i386_sysv_elf_gas.S deleted file mode 100644 index 7c94ea0..0000000 --- a/vendor/boost_1.51/libs/context/asm/fcontext_i386_sysv_elf_gas.S +++ /dev/null @@ -1,122 +0,0 @@ -/* - Copyright Oliver Kowalke 2009. - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or copy at - http://www.boost.org/LICENSE_1_0.txt) -*/ - -/******************************************************************** - * * - * -------------------------------------------------------------- * - * | 0 | 1 | 2 | 3 | 4 | 5 | * - * -------------------------------------------------------------- * - * | 0x0 | 0x4 | 0x8 | 0xc | 0x10 | 0x14 | * - * -------------------------------------------------------------- * - * | EDI | ESI | EBX | EBP | ESP | EIP | * - * -------------------------------------------------------------- * - * -------------------------------------------------------------- * - * | 6 | 7 | | * - * -------------------------------------------------------------- * - * | 0x18 | 0x1c | | * - * -------------------------------------------------------------- * - * | sbase | slimit | | * - * -------------------------------------------------------------- * - * -------------------------------------------------------------- * - * | 8 | 9 | | * - * -------------------------------------------------------------- * - * | 0x20 | 0x24 | | * - * -------------------------------------------------------------- * - * | fc_mxcsr|fc_x87_cw| | * - * -------------------------------------------------------------- * - * * - * *****************************************************************/ - -.text -.globl jump_fcontext -.align 2 -.type jump_fcontext,@function -jump_fcontext: - movl 0x4(%esp), %ecx /* load address of the first fcontext_t arg */ - movl %edi, (%ecx) /* save EDI */ - movl %esi, 0x4(%ecx) /* save ESI */ - movl %ebx, 0x8(%ecx) /* save EBX */ - movl %ebp, 0xc(%ecx) /* save EBP */ - - leal 0x4(%esp), %eax /* exclude the return address */ - movl %eax, 0x10(%ecx) /* save as stack pointer */ - movl (%esp), %eax /* load return address */ - movl %eax, 0x14(%ecx) /* save return address */ - - movl 0x8(%esp), %edx /* load address of the second fcontext_t arg */ - movl (%edx), %edi /* restore EDI */ - movl 0x4(%edx), %esi /* restore ESI */ - movl 0x8(%edx), %ebx /* restore EBX */ - movl 0xc(%edx), %ebp /* restore EBP */ - - movl 0x10(%esp), %eax /* check if fpu enve preserving was requested */ - test %eax, %eax - je 1f - - stmxcsr 0x20(%ecx) /* save MMX control and status word */ - fnstcw 0x24(%ecx) /* save x87 control word */ - ldmxcsr 0x20(%edx) /* restore MMX control and status word */ - fldcw 0x24(%edx) /* restore x87 control word */ -1: - movl 0xc(%esp), %eax /* use third arg as return value after jump */ - - movl 0x10(%edx), %esp /* restore ESP */ - movl %eax, 0x4(%esp) /* use third arg as first arg in context function */ - movl 0x14(%edx), %edx /* fetch the address to return to */ - - jmp *%edx /* indirect jump to context */ -.size jump_fcontext,.-jump_fcontext - -.text -.globl make_fcontext -.align 2 -.type make_fcontext,@function -make_fcontext: - movl 0x4(%esp), %eax /* load address of the fcontext_t */ - movl %eax, (%eax) /* save the address of current context */ - movl 0x8(%esp), %ecx /* load the address of the context function */ - movl %ecx, 0x14(%eax) /* save the address of the context function */ - movl 0x18(%eax), %edx /* load the stack base */ - - pushl %eax /* save pointer to fcontext_t */ - pushl %ebx /* save EBX */ - pushl %edx /* stack pointer as arg for align_stack */ - call 1f -1: popl %ebx /* address of label 1 */ - addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx /* compute address of GOT and store it in EBX */ - call align_stack@PLT /* align stack */ - movl %eax, %edx /* begin of aligned stack */ - popl %eax /* remove arg for align_stack */ - popl %ebx /* restore EBX */ - popl %eax /* restore pointer to fcontext_t */ - - leal -0x14(%edx), %edx /* reserve space for the last frame on stack, (ESP + 4) % 16 == 0 */ - movl %edx, 0x10(%eax) /* save the aligned stack base */ - - stmxcsr 0x20(%eax) /* save MMX control and status word */ - fnstcw 0x24(%eax) /* save x87 control word */ - - call 2f -2: popl %ecx /* address of label 2 */ - addl $finish-2b, %ecx /* helper code executed after context function returns */ - movl %ecx, (%edx) - - xorl %eax, %eax - ret - -finish: - leal -0xc(%esp), %esp - - call 3f -3: popl %ebx /* address of label 3 */ - addl $_GLOBAL_OFFSET_TABLE_+[.-3b], %ebx /* compute address of GOT and store it in EBX */ - - xorl %eax, %eax - pushl %eax /* exit code is zero */ - call _exit@PLT /* exit application */ - hlt -.size make_fcontext,.-make_fcontext diff --git a/vendor/boost_1.51/libs/context/asm/fcontext_i386_sysv_macho_gas.S b/vendor/boost_1.51/libs/context/asm/fcontext_i386_sysv_macho_gas.S deleted file mode 100644 index a28c875..0000000 --- a/vendor/boost_1.51/libs/context/asm/fcontext_i386_sysv_macho_gas.S +++ /dev/null @@ -1,118 +0,0 @@ -/* - Copyright Oliver Kowalke 2009. - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or copy at - http://www.boost.org/LICENSE_1_0.txt) -*/ - -/******************************************************************** - * * - * -------------------------------------------------------------- * - * | 0 | 1 | 2 | 3 | 4 | 5 | * - * -------------------------------------------------------------- * - * | 0x0 | 0x4 | 0x8 | 0xc | 0x10 | 0x14 | * - * -------------------------------------------------------------- * - * | EDI | ESI | EBX | EBP | ESP | EIP | * - * -------------------------------------------------------------- * - * -------------------------------------------------------------- * - * | 6 | 7 | | * - * -------------------------------------------------------------- * - * | 0x18 | 0x1c | | * - * -------------------------------------------------------------- * - * | sbase | slimit | | * - * -------------------------------------------------------------- * - * -------------------------------------------------------------- * - * | 8 | 9 | | * - * -------------------------------------------------------------- * - * | 0x20 | 0x24 | | * - * -------------------------------------------------------------- * - * | fc_mxcsr|fc_x87_cw| | * - * -------------------------------------------------------------- * - * * - * *****************************************************************/ - -.text -.globl _jump_fcontext -.align 2 -_jump_fcontext: - movl 0x4(%esp), %ecx /* load address of the first fcontext_t arg */ - movl %edi, (%ecx) /* save EDI */ - movl %esi, 0x4(%ecx) /* save ESI */ - movl %ebx, 0x8(%ecx) /* save EBX */ - movl %ebp, 0xc(%ecx) /* save EBP */ - - leal 0x4(%esp), %eax /* exclude the return address */ - movl %eax, 0x10(%ecx) /* save as stack pointer */ - movl (%esp), %eax /* load return address */ - movl %eax, 0x14(%ecx) /* save return address */ - - movl 0x8(%esp), %edx /* load address of the second fcontext_t arg */ - movl (%edx), %edi /* restore EDI */ - movl 0x4(%edx), %esi /* restore ESI */ - movl 0x8(%edx), %ebx /* restore EBX */ - movl 0xc(%edx), %ebp /* restore EBP */ - - movl 0x10(%esp), %eax /* check if fpu enve preserving was requested */ - test %eax, %eax - je 1f - - stmxcsr 0x20(%ecx) /* save MMX control and status word */ - fnstcw 0x24(%ecx) /* save x87 control word */ - ldmxcsr 0x20(%edx) /* restore MMX control and status word */ - fldcw 0x24(%edx) /* restore x87 control word */ -1: - movl 0xc(%esp), %eax /* use third arg as return value after jump */ - - movl 0x10(%edx), %esp /* restore ESP */ - movl %eax, 0x4(%esp) /* use third arg as first arg in context function */ - movl 0x14(%edx), %edx /* fetch the address to return to */ - - jmp *%edx /* indirect jump to context */ - -.text -.globl _make_fcontext -.align 2 -_make_fcontext: - movl 0x4(%esp), %eax /* load address of the fcontext_t */ - movl %eax, (%eax) /* save the address of current context */ - movl 0x8(%esp), %ecx /* load the address of the context function */ - movl %ecx, 0x14(%eax) /* save the address of the context function */ - movl 0x18(%eax), %edx /* load the stack base */ - - pushl %eax /* save pointer to fcontext_t */ - pushl %ebx /* save EBX */ - pushl %edx /* stack pointer as arg for align_stack */ - call 1f -1: popl %ebx /* address of label 1 */ - addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx /* compute address of GOT and store it in EBX */ - call align_stack@PLT /* align stack */ - movl %eax, %edx /* begin of aligned stack */ - popl %eax /* remove arg for align_stack */ - popl %ebx /* restore EBX */ - popl %eax /* restore pointer to fcontext_t */ - - leal -0x14(%edx), %edx /* reserve space for the last frame on stack, (ESP + 4) % 16 == 0 */ - movl %edx, 0x10(%eax) /* save the aligned stack base */ - - stmxcsr 0x20(%eax) /* save MMX control and status word */ - fnstcw 0x24(%eax) /* save x87 control word */ - - call 2f -2: popl %ecx /* address of label 2 */ - addl $finish-2b, %ecx /* helper code executed after context function returns */ - movl %ecx, (%edx) - - xorl %eax, %eax - ret - -finish: - leal -0xc(%esp), %esp - - call 3f -3: popl %ebx /* address of label 3 */ - addl $_GLOBAL_OFFSET_TABLE_+[.-3b], %ebx /* compute address of GOT and store it in EBX */ - - xorl %eax, %eax - pushl %eax /* exit code is zero */ - call _exit@PLT /* exit application */ - hlt diff --git a/vendor/boost_1.51/libs/context/asm/fcontext_mips32_o32_elf_gas.S b/vendor/boost_1.51/libs/context/asm/fcontext_mips32_o32_elf_gas.S deleted file mode 100644 index be86f18..0000000 --- a/vendor/boost_1.51/libs/context/asm/fcontext_mips32_o32_elf_gas.S +++ /dev/null @@ -1,144 +0,0 @@ -/* - Copyright Oliver Kowalke 2009. - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or copy at - http://www.boost.org/LICENSE_1_0.txt) -*/ - -/******************************************************************* - * * - * ------------------------------------------------------------- * - * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | * - * ------------------------------------------------------------- * - * | 0 | 8 | 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72 | * - * ------------------------------------------------------------- * - * | S0 | S1 | S2 | S3 | S4 | S5 | S6 | S7 | GP | SP | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 10 | 11 | 12 | | * - * ------------------------------------------------------------- * - * | 80 | 88 | 96 | | * - * ------------------------------------------------------------- * - * | S8 | RA | PC | | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 13 | 14 | | * - * ------------------------------------------------------------- * - * | 104 | 112 | | * - * ------------------------------------------------------------- * - * |sbase|slimt| | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 15 | 16 | 17 | 18 | 19 | 20 | | * - * ------------------------------------------------------------- * - * | 120 | 128 | 136 | 144 | 152 | 160 | | * - * ------------------------------------------------------------- * - * | F20 | F22 | F24 | F26 | F28 | F30 | | * - * ------------------------------------------------------------- * - * * - * *****************************************************************/ - -.text -.globl jump_fcontext -.align 2 -.type jump_fcontext,@function -.ent jump_fcontext -jump_fcontext: - sw $s0, ($a0) # save S0 - sw $s1, 8($a0) # save S1 - sw $s2, 16($a0) # save S2 - sw $s3, 24($a0) # save S3 - sw $s4, 32($a0) # save S4 - sw $s5, 40($a0) # save S5 - sw $s6, 48($a0) # save S6 - sw $s7, 56($a0) # save S7 - sw $gp, 64($a0) # save GP - sw $sp, 72($a0) # save SP - sw $s8, 80($a0) # save S8 - sw $ra, 88($a0) # save RA - sw $ra, 96($a0) # save RA as PC - -#if defined(__mips_hard_float) - beqz $a3, 1f # test if fpu env should be preserved - s.d $f20, 120($a0) # save F20 - s.d $f22, 128($a0) # save F22 - s.d $f24, 136($a0) # save F24 - s.d $f26, 144($a0) # save F26 - s.d $f28, 152($a0) # save F28 - s.d $f30, 160($a0) # save F30 - - l.d $f20, 120($a1) # restore F20 - l.d $f22, 128($a1) # restore F22 - l.d $f24, 136($a1) # restore F24 - l.d $f26, 144($a1) # restore F26 - l.d $f28, 152($a1) # restore F28 - l.d $f30, 160($a1) # restore F30 -1: -#endif - - lw $s0, ($a1) # restore S0 - lw $s1, 8($a1) # restore S1 - lw $s2, 16($a1) # restore S2 - lw $s3, 24($a1) # restore S3 - lw $s4, 32($a1) # restore S4 - lw $s5, 40($a1) # restore S5 - lw $s6, 48($a1) # restore S6 - lw $s7, 56($a1) # restore S7 - lw $gp, 64($a1) # restore GP - lw $sp, 72($a1) # restore SP - lw $s8, 80($a1) # restore S8 - lw $ra, 88($a1) # restore RA - move $a0, $s2 # restore void pointer as argument - - move $v0, $a2 # use third arg as return value after jump - move $a0, $a2 # use third arg as first arg in context function - - lw $t9, 96($a1) # load PC - jr $t9 # jump to context -.end jump_fcontext -.size jump_fcontext, .-jump_fcontext - -.text -.globl make_fcontext -.align 2 -.type make_fcontext,@function -.ent make_fcontext -make_fcontext: -#ifdef __PIC__ -.set noreorder -.cpload $t9 -.set reorder -#endif - sw $a0, ($a0) # save the current context - sw $gp, 24($a0) # save global pointer - sw $a1, 96($a0) # save the address of the context function - lw $t0, 104($a0) # load the stack base - - sub $sp, $sp, 28 - sw $ra, 24($sp) - sw $a0, 20($sp) - move $a0, $t0 # stack pointer as arg for align_stack - lw $t9, %call16(align_stack)($gp) # align stack - jalr $t9 - nop - move $t0, $v0 # begin of aligned stack - lw $ra, 24($sp) - lw $a0, 20($sp) - addi $sp, $sp, 28 - - sub $t0, $t0, 16 # reserve 16 byte of argument space - sw $t0, 72($a0) # save the algned stack base - - la $t9, finish # helper code executed after context function returns - sw $t9, 88($a0) - - move $v0, $zero - jr $ra - -finish: - move $gp, $s3 # restore GP (global pointer) - move $a0, $zero # exit code is zero - lw $t9, %call16(_exit)($gp) # exit application - jalr $t9 -.end make_fcontext -.size make_fcontext, .-make_fcontext diff --git a/vendor/boost_1.51/libs/context/asm/fcontext_ppc32_sysv_elf_gas.S b/vendor/boost_1.51/libs/context/asm/fcontext_ppc32_sysv_elf_gas.S deleted file mode 100644 index 69b6ed9..0000000 --- a/vendor/boost_1.51/libs/context/asm/fcontext_ppc32_sysv_elf_gas.S +++ /dev/null @@ -1,222 +0,0 @@ -/* - Copyright Oliver Kowalke 2009. - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or copy at - http://www.boost.org/LICENSE_1_0.txt) -*/ - -/******************************************************************* - * * - * ------------------------------------------------------------- * - * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | * - * ------------------------------------------------------------- * - * | 0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | * - * ------------------------------------------------------------- * - * | R13 | R14 | R15 | R16 | R17 | R18 | R19 | R20 | R21 | R22 | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | * - * ------------------------------------------------------------- * - * | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 68 | 72 | 76 | * - * ------------------------------------------------------------- * - * | R23 | R24 | R25 | R26 | R27 | R28 | R29 | R30 | R31 | SP | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 20 | 21 | 22 | | * - * ------------------------------------------------------------- * - * | 80 | 84 | 88 | | * - * ------------------------------------------------------------- * - * | CR | LR | PC | | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 23 | 24 | | * - * ------------------------------------------------------------- * - * | 92 | 96 | | * - * ------------------------------------------------------------- * - * |sbase|slimt| | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | * - * ------------------------------------------------------------- * - * | 100 | 104 | 108 | 112 | 116 | 120 | 124 | 128 | 132 | 136 | * - * ------------------------------------------------------------- * - * | F14 | F15 | F16 | F17 | F18 | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | * - * ------------------------------------------------------------- * - * | 140 | 144 | 148 | 152 | 156 | 160 | 164 | 168 | 172 | 176 | * - * ------------------------------------------------------------- * - * | F19 | F20 | F21 | F22 | F23 | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | * - * ------------------------------------------------------------- * - * | 180 | 184 | 188 | 192 | 196 | 200 | 204 | 208 | 212 | 216 | * - * ------------------------------------------------------------- * - * | F24 | F25 | F26 | F27 | F28 | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | | * - * ------------------------------------------------------------- * - * | 220 | 224 | 228 | 232 | 236 | 240 | 244 | 248 | | * - * ------------------------------------------------------------- * - * | F29 | F30 | F31 | fpscr | | * - * ------------------------------------------------------------- * - * * - * *****************************************************************/ - -.text -.globl jump_fcontext -.align 2 -.type jump_fcontext,@function -jump_fcontext: - stw %r13, 0(%r3) # save R13 - stw %r14, 4(%r3) # save R14 - stw %r15, 8(%r3) # save R15 - stw %r16, 12(%r3) # save R16 - stw %r17, 16(%r3) # save R17 - stw %r18, 20(%r3) # save R18 - stw %r19, 24(%r3) # save R19 - stw %r20, 28(%r3) # save R20 - stw %r21, 32(%r3) # save R21 - stw %r22, 36(%r3) # save R22 - stw %r23, 40(%r3) # save R23 - stw %r24, 44(%r3) # save R24 - stw %r25, 48(%r3) # save R25 - stw %r26, 52(%r3) # save R26 - stw %r27, 56(%r3) # save R27 - stw %r28, 60(%r3) # save R28 - stw %r29, 64(%r3) # save R29 - stw %r30, 68(%r3) # save R30 - stw %r31, 72(%r3) # save R31 - stw %r1, 76(%r3) # save SP - - mfcr %r0 # load CR - stw %r0, 80(%r3) # save CR - mflr %r0 # load LR - stw %r0, 84(%r3) # save LR - stw %r0, 88(%r3) # save LR as PC - - cmpwi cr7, %r6, 0 # test if fpu env should be preserved - beq cr7, 1f - - stfd %f14, 100(%r3) # save F14 - stfd %f15, 108(%r3) # save F15 - stfd %f16, 116(%r3) # save F16 - stfd %f17, 124(%r3) # save F17 - stfd %f18, 132(%r3) # save F18 - stfd %f19, 140(%r3) # save F19 - stfd %f20, 148(%r3) # save F20 - stfd %f21, 156(%r3) # save F21 - stfd %f22, 164(%r3) # save F22 - stfd %f23, 172(%r3) # save F23 - stfd %f24, 180(%r3) # save F24 - stfd %f25, 188(%r3) # save F25 - stfd %f26, 196(%r3) # save F26 - stfd %f27, 204(%r3) # save F27 - stfd %f28, 212(%r3) # save F28 - stfd %f29, 220(%r3) # save F29 - stfd %f30, 228(%r3) # save F30 - stfd %f31, 236(%r3) # save F31 - mffs %f0 # load FPSCR - stfd %f0, 244(%r3) # save FPSCR - - lfd %f14, 100(%r4) # restore F14 - lfd %f15, 108(%r4) # restore F15 - lfd %f16, 116(%r4) # restore F16 - lfd %f17, 124(%r4) # restore F17 - lfd %f18, 132(%r4) # restore F18 - lfd %f19, 140(%r4) # restore F19 - lfd %f20, 148(%r4) # restore F20 - lfd %f21, 156(%r4) # restore F21 - lfd %f22, 164(%r4) # restore F22 - lfd %f23, 172(%r4) # restore F23 - lfd %f24, 180(%r4) # restore F24 - lfd %f25, 188(%r4) # restore F25 - lfd %f26, 196(%r4) # restore F26 - lfd %f27, 204(%r4) # restore F27 - lfd %f28, 212(%r4) # restore F28 - lfd %f29, 220(%r4) # restore F29 - lfd %f30, 228(%r4) # restore F30 - lfd %f31, 236(%r4) # restore F31 - lfd %f0, 244(%r4) # load FPSCR - mtfsf 0xff, %f0 # restore FPSCR -1: - - lwz %r13, 0(%r4) # restore R13 - lwz %r14, 4(%r4) # restore R14 - lwz %r15, 8(%r4) # restore R15 - lwz %r16, 12(%r4) # restore R16 - lwz %r17, 16(%r4) # restore R17 - lwz %r18, 20(%r4) # restore R18 - lwz %r19, 24(%r4) # restore R19 - lwz %r20, 28(%r4) # restore R20 - lwz %r21, 32(%r4) # restore R21 - lwz %r22, 36(%r4) # restore R22 - lwz %r23, 40(%r4) # restore R23 - lwz %r24, 44(%r4) # restore R24 - lwz %r25, 48(%r4) # restore R25 - lwz %r26, 52(%r4) # restore R26 - lwz %r27, 56(%r4) # restore R27 - lwz %r28, 60(%r4) # restore R28 - lwz %r29, 64(%r4) # restore R29 - lwz %r30, 68(%r4) # restore R30 - lwz %r31, 72(%r4) # restore R31 - lwz %r1, 76(%r4) # restore SP - - lwz %r0, 80(%r4) # load CR - mtcr %r0 # restore CR - lwz %r0, 84(%r4) # load LR - mtlr %r0 # restore LR - - mr. %r3, %r5 # use third arg as return value after jump - # and as first arg in context function - - lwz %r0, 88(%r4) # load PC - mtctr %r0 # restore CTR - - bctr # jump to context -.size jump_fcontext, .-jump_fcontext - -.text -.globl make_fcontext -.align 2 -.type make_fcontext,@function -make_fcontext: - stw %r3, 0(%r3) # save the current context - stw %r4, 88(%r3) # save the address of the context function - lwz %r0, 92(%r3) # load the stack base - - li %r4, 28 - subf %r1, %r4, %r1 # reserve space on stack - stw %r3, 24(%r1) # store pointer to fcontext_t on stack - mflr %r4 # load LR - stw %r4, 20(%r1) # store LR on stack - mr. %r3, %r0 # context stack as arg to align_stack - bl align_stack@plt # call align_stack - mr. %r0, %r3 # load result into R0 - lwz %r4, 20(%r1) # pop LR from stack - mtlr %r4 # restore LR - lwz %r3, 24(%r1) # pop pointer to fcontext_t from stack - addi %r1, %r1, 28 # release space on stack - - li %r4, 32 - subf %r0, %r4, %r0 # 32 bytes on stack for parameter area(== 8 registers) - stw %r0, 76(%r3) # save the aligned stack base - - mflr %r0 # load LR - bl 1f # jump to label 1 -1: - mflr %r4 # load LR - addi %r4, %r4, finish - 1b # address of finish; called after context function returns - mtlr %r0 # restore LR - stw %r4, 84(%r3) - - li %r3, 0 - blr - -finish: - li %r3, 0 # exit code is zero - bl _exit@plt # exit application -.size make_fcontext, .-make_fcontext diff --git a/vendor/boost_1.51/libs/context/asm/fcontext_ppc64_sysv_elf_gas.S b/vendor/boost_1.51/libs/context/asm/fcontext_ppc64_sysv_elf_gas.S deleted file mode 100644 index 0fcb387..0000000 --- a/vendor/boost_1.51/libs/context/asm/fcontext_ppc64_sysv_elf_gas.S +++ /dev/null @@ -1,250 +0,0 @@ -/* - Copyright Oliver Kowalke 2009. - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or copy at - http://www.boost.org/LICENSE_1_0.txt) -*/ - -/******************************************************************* - * * - * ------------------------------------------------------------- * - * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | * - * ------------------------------------------------------------- * - * | 0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | * - * ------------------------------------------------------------- * - * | R13 | R14 | R15 | R16 | R17 | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | * - * ------------------------------------------------------------- * - * | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 68 | 72 | 76 | * - * ------------------------------------------------------------- * - * | R18 | R19 | R20 | R21 | R22 | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | * - * ------------------------------------------------------------- * - * | 80 | 84 | 88 | 92 | 96 | 100 | 104 | 108 | 112 | 116 | * - * ------------------------------------------------------------- * - * | R23 | R24 | R25 | R26 | R27 | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | * - * ------------------------------------------------------------- * - * | 120 | 124 | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | * - * ------------------------------------------------------------- * - * | R28 | R29 | R30 | R31 | SP | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 40 | 41 | 42 | 43 | 44 | 45 | | * - * ------------------------------------------------------------- * - * | 160 | 164 | 168 | 172 | 176 | 180 | | * - * ------------------------------------------------------------- * - * | CR | LR | PC | | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 46 | 47 | 48 | 49 | | * - * ------------------------------------------------------------- * - * | 184 | 188 | 192 | 196 | | * - * ------------------------------------------------------------- * - * | sbase | slimt | | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | * - * ------------------------------------------------------------- * - * | 200 | 204 | 208 | 212 | 216 | 220 | 224 | 228 | 232 | 236 | * - * ------------------------------------------------------------- * - * | F14 | F15 | F16 | F17 | F18 | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | * - * ------------------------------------------------------------- * - * | 240 | 244 | 248 | 252 | 256 | 260 | 264 | 268 | 272 | 276 | * - * ------------------------------------------------------------- * - * | F19 | F20 | F21 | F22 | F23 | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | * - * ------------------------------------------------------------- * - * | 280 | 284 | 288 | 292 | 296 | 300 | 304 | 308 | 312 | 316 | * - * ------------------------------------------------------------- * - * | F24 | F25 | F26 | F27 | F28 | * - * ------------------------------------------------------------- * - * ------------------------------------------------------------- * - * | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | | * - * ------------------------------------------------------------- * - * | 320 | 324 | 328 | 332 | 336 | 340 | 344 | 348 | | * - * ------------------------------------------------------------- * - * | F29 | F30 | F31 | fpscr | | * - * ------------------------------------------------------------- * - * * - * *****************************************************************/ - -.section ".text" -.align 2 -.globl jump_fcontext -.section ".opd","aw" -.align 3 -jump_fcontext: -.quad .jump_fcontext,.TOC.@tocbase,0 -.previous -.size jump_fcontext,24 -.type .jump_fcontext,@function -.globl .jump_fcontext -.jump_fcontext: - std %r13, 0(%r3) # save R13 - std %r14, 8(%r3) # save R14 - std %r15, 16(%r3) # save R15 - std %r16, 24(%r3) # save R16 - std %r17, 32(%r3) # save R17 - std %r18, 40(%r3) # save R18 - std %r19, 48(%r3) # save R19 - std %r20, 56(%r3) # save R20 - std %r21, 64(%r3) # save R21 - std %r22, 72(%r3) # save R22 - std %r23, 80(%r3) # save R23 - std %r24, 88(%r3) # save R24 - std %r25, 96(%r3) # save R25 - std %r26, 104(%r3) # save R26 - std %r27, 112(%r3) # save R27 - std %r28, 120(%r3) # save R28 - std %r29, 128(%r3) # save R29 - std %r30, 136(%r3) # save R30 - std %r31, 144(%r3) # save R31 - std %r1, 152(%r3) # save SP - - mfcr %r0 # load CR - std %r0, 160(%r3) # save CR - mflr %r0 # load LR - std %r0, 168(%r3) # save LR - std %r0, 176(%r3) # save LR as PC - - cmpwi cr7, %r6, 0 # test if fpu env should be preserved - beq cr7, 1f - - stfd %f14, 200(%r3) # save F14 - stfd %f15, 208(%r3) # save F15 - stfd %f16, 216(%r3) # save F16 - stfd %f17, 224(%r3) # save F17 - stfd %f18, 232(%r3) # save F18 - stfd %f19, 240(%r3) # save F19 - stfd %f20, 248(%r3) # save F20 - stfd %f21, 256(%r3) # save F21 - stfd %f22, 264(%r3) # save F22 - stfd %f23, 272(%r3) # save F23 - stfd %f24, 280(%r3) # save F24 - stfd %f25, 288(%r3) # save F25 - stfd %f26, 296(%r3) # save F26 - stfd %f27, 304(%r3) # save F27 - stfd %f28, 312(%r3) # save F28 - stfd %f29, 320(%r3) # save F29 - stfd %f30, 328(%r3) # save F30 - stfd %f31, 336(%r3) # save F31 - mffs %f0 # load FPSCR - stfd %f0, 344(%r3) # save FPSCR - - lfd %f14, 200(%r4) # restore F14 - lfd %f15, 208(%r4) # restore F15 - lfd %f16, 216(%r4) # restore F16 - lfd %f17, 224(%r4) # restore F17 - lfd %f18, 232(%r4) # restore F18 - lfd %f19, 240(%r4) # restore F19 - lfd %f20, 248(%r4) # restore F20 - lfd %f21, 256(%r4) # restore F21 - lfd %f22, 264(%r4) # restore F22 - lfd %f23, 272(%r4) # restore F23 - lfd %f24, 280(%r4) # restore F24 - lfd %f25, 288(%r4) # restore F25 - lfd %f26, 296(%r4) # restore F26 - lfd %f27, 304(%r4) # restore F27 - lfd %f28, 312(%r4) # restore F28 - lfd %f29, 320(%r4) # restore F29 - lfd %f30, 328(%r4) # restore F30 - lfd %f31, 336(%r4) # restore F31 - lfd %f0, 344(%r4) # load FPSCR - mtfsf 0xff, %f0 # restore FPSCR -1: - - ld %r13, 0(%r4) # restore R13 - ld %r14, 8(%r4) # restore R14 - ld %r15, 16(%r4) # restore R15 - ld %r16, 24(%r4) # restore R16 - ld %r17, 32(%r4) # restore R17 - ld %r18, 40(%r4) # restore R18 - ld %r19, 48(%r4) # restore R19 - ld %r20, 56(%r4) # restore R20 - ld %r21, 64(%r4) # restore R21 - ld %r22, 72(%r4) # restore R22 - ld %r23, 80(%r4) # restore R23 - ld %r24, 88(%r4) # restore R24 - ld %r25, 96(%r4) # restore R25 - ld %r26, 104(%r4) # restore R26 - ld %r27, 112(%r4) # restore R27 - ld %r28, 120(%r4) # restore R28 - ld %r29, 128(%r4) # restore R29 - ld %r30, 136(%r4) # restore r30 - ld %r31, 144(%r4) # restore r31 - ld %r1, 152(%r4) # restore SP - - ld %r0, 160(%r4) # load CR - mtcr %r0 # restore CR - ld %r0, 168(%r4) # load LR - mtlr %r0 # restore LR - - mr. %r3, %r5 # use third arg as return value after jump - # and as first arg in context function - - ld %r0, 176(%r4) # load PC - mtctr %r0 # restore CTR - - bctr # jump to context -.size .jump_fcontext, .-.jump_fcontext - -.section ".text" -.align 2 -.globl make_fcontext -.section ".opd","aw" -.align 3 -make_fcontext: -.quad .make_fcontext,.TOC.@tocbase,0 -.previous -.size make_fcontext,24 -.type .make_fcontext,@function -.globl .make_fcontext -.make_fcontext: - std %r3, 0(%r3) # save the current context - std %r4, 176(%r3) # save the address of the function supposed to be run - ld %r0, 184(%r3) # load the stack base - - li %r4, 56 - subf %r1, %r4, %r1 # reserve space on stack - stw %r3, 48(%r1) # store pointer to fcontext_t on stack - mflr %r4 # load LR - stw %r4, 40(%r1) # store LR on stack - mr. %r3, %r0 # context stack as arg to align_stack - bl align_stack@plt # call align_stack - mr. %r0, %r3 # load result into R0 - lwz %r4, 40(%r1) # pop LR from stack - mtlr %r4 # restore LR - lwz %r3, 48(%r1) # pop pointer to fcontext_t from stack - addi %r1, %r1, 56 # release space on stack - - li %r4, 64 - subf %r0, %r4, %r0 # 64 bytes on stack for parameter area (== 8 registers) - std %r0, 152(%r3) # save the stack base - - mflr %r0 # load LR - bl 1f # jump to label 1 -1: - mflr %r4 # load LR - addi %r4, %r4, finish - 1b # calulate absolute address of finish - mtlr %r0 # restore LR - std %r4, 168(%r3) # save address of finish - - li %r3, 0 # set return value to zero - blr - -finish: - li %r3, 0 # set return value to zero - bl _exit@plt # exit application -.size .make_fcontext, .-.make_fcontext diff --git a/vendor/boost_1.51/libs/context/asm/fcontext_x86_64_ms_pe_masm.asm b/vendor/boost_1.51/libs/context/asm/fcontext_x86_64_ms_pe_masm.asm deleted file mode 100644 index f1f8ca1..0000000 --- a/vendor/boost_1.51/libs/context/asm/fcontext_x86_64_ms_pe_masm.asm +++ /dev/null @@ -1,207 +0,0 @@ - -; Copyright Oliver Kowalke 2009. -; Distributed under the Boost Software License, Version 1.0. -; (See accompanying file LICENSE_1_0.txt or copy at -; http://www.boost.org/LICENSE_1_0.txt) - -; ---------------------------------------------------------------------------------- -; | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | -; ---------------------------------------------------------------------------------- -; | 0x0 | 0x4 | 0x8 | 0xc | 0x10 | 0x14 | 0x18 | 0x1c | -; ---------------------------------------------------------------------------------- -; | R12 | R13 | R14 | R15 | -; ---------------------------------------------------------------------------------- -; ---------------------------------------------------------------------------------- -; | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -; ---------------------------------------------------------------------------------- -; | 0x20 | 0x24 | 0x28 | 0x2c | 0x30 | 0x34 | 0x38 | 0x3c | -; ---------------------------------------------------------------------------------- -; | RDI | RSI | RBX | RBP | -; ---------------------------------------------------------------------------------- -; ---------------------------------------------------------------------------------- -; | 16 | 17 | 18 | 19 | | -; ---------------------------------------------------------------------------------- -; | 0x40 | 0x44 | 0x48 | 0x4c | | -; ---------------------------------------------------------------------------------- -; | RSP | RIP | | -; ---------------------------------------------------------------------------------- -; ---------------------------------------------------------------------------------- -; | 20 | 21 | 22 | 23 | | -; ---------------------------------------------------------------------------------- -; | 0x50 | 0x54 | 0x58 | 0x5c | | -; ---------------------------------------------------------------------------------- -; | sbase | slimit | | -; ---------------------------------------------------------------------------------- -; ---------------------------------------------------------------------------------- -; | 24 | 25 | | -; ---------------------------------------------------------------------------------- -; | 0x60 | 0x64 | | -; ---------------------------------------------------------------------------------- -; | fbr_strg | | -; ---------------------------------------------------------------------------------- -; ---------------------------------------------------------------------------------- -; | 26 | 27 | 28 | 29 | | -; ---------------------------------------------------------------------------------- -; | 0x68 | 0x6c | 0x70 | 0x74 | | -; ---------------------------------------------------------------------------------- -; | fc_mxcsr|fc_x87_cw| fc_xmm | | -; ---------------------------------------------------------------------------------- -; ---------------------------------------------------------------------------------- -; | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -; ---------------------------------------------------------------------------------- -; | 0x78 | 0x7c | 0x80 | 0x84 | 0x88 | 0x8c | 0x90 | 0x94 | -; ---------------------------------------------------------------------------------- -; | XMM6 | XMM7 | -; ---------------------------------------------------------------------------------- -; ---------------------------------------------------------------------------------- -; | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -; ---------------------------------------------------------------------------------- -; | 0x98 | 0x9c | 0x100 | 0x104 | 0x108 | 0x10c | 0x110 | 0x114 | -; ---------------------------------------------------------------------------------- -; | XMM8 | XMM9 | -; ---------------------------------------------------------------------------------- -; ---------------------------------------------------------------------------------- -; | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -; ---------------------------------------------------------------------------------- -; | 0x118 | 0x11c | 0x120 | 0x124 | 0x128 | 0x12c | 0x130 | 0x134 | -; ---------------------------------------------------------------------------------- -; | XMM10 | XMM11 | -; ---------------------------------------------------------------------------------- -; ---------------------------------------------------------------------------------- -; | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -; ---------------------------------------------------------------------------------- -; | 0x138 | 0x13c | 0x140 | 0x144 | 0x148 | 0x14c | 0x150 | 0x154 | -; ---------------------------------------------------------------------------------- -; | XMM12 | XMM13 | -; ---------------------------------------------------------------------------------- -; ---------------------------------------------------------------------------------- -; | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -; ---------------------------------------------------------------------------------- -; | 0x158 | 0x15c | 0x160 | 0x164 | 0x168 | 0x16c | 0x170 | 0x174 | -; ---------------------------------------------------------------------------------- -; | XMM14 | XMM15 | -; ---------------------------------------------------------------------------------- - -EXTERN _exit:PROC ; standard C library function -EXTERN align_stack:PROC ; stack alignment -EXTERN seh_fcontext:PROC ; exception handler -.code - -jump_fcontext PROC EXPORT FRAME:seh_fcontext - .endprolog - - mov [rcx], r12 ; save R12 - mov [rcx+08h], r13 ; save R13 - mov [rcx+010h], r14 ; save R14 - mov [rcx+018h], r15 ; save R15 - mov [rcx+020h], rdi ; save RDI - mov [rcx+028h], rsi ; save RSI - mov [rcx+030h], rbx ; save RBX - mov [rcx+038h], rbp ; save RBP - - mov r10, gs:[030h] ; load NT_TIB - mov rax, [r10+08h] ; load current stack base - mov [rcx+050h], rax ; save current stack base - mov rax, [r10+010h] ; load current stack limit - mov [rcx+058h], rax ; save current stack limit - mov rax, [r10+018h] ; load fiber local storage - mov [rcx+060h], rax ; save fiber local storage - - test r9, r9 - je nxt - - stmxcsr [rcx+068h] ; save MMX control and status word - fnstcw [rcx+06ch] ; save x87 control word - mov r10, [rcx+070h] ; address of aligned XMM storage - movaps [r10], xmm6 - movaps [r10+010h], xmm7 - movaps [r10+020h], xmm8 - movaps [r10+030h], xmm9 - movaps [r10+040h], xmm10 - movaps [r10+050h], xmm11 - movaps [r10+060h], xmm12 - movaps [r10+070h], xmm13 - movaps [r10+080h], xmm14 - movaps [r10+090h], xmm15 - - ldmxcsr [rdx+068h] ; restore MMX control and status word - fldcw [rdx+06ch] ; restore x87 control word - mov r10, [rdx+070h] ; address of aligned XMM storage - movaps xmm6, [r10] - movaps xmm7, [r10+010h] - movaps xmm8, [r10+020h] - movaps xmm9, [r10+030h] - movaps xmm10, [r10+040h] - movaps xmm11, [r10+050h] - movaps xmm12, [r10+060h] - movaps xmm13, [r10+070h] - movaps xmm14, [r10+080h] - movaps xmm15, [r10+090h] -nxt: - - lea rax, [rsp+08h] ; exclude the return address - mov [rcx+040h], rax ; save as stack pointer - mov rax, [rsp] ; load return address - mov [rcx+048h], rax ; save return address - - mov r12, [rdx] ; restore R12 - mov r13, [rdx+08h] ; restore R13 - mov r14, [rdx+010h] ; restore R14 - mov r15, [rdx+018h] ; restore R15 - mov rdi, [rdx+020h] ; restore RDI - mov rsi, [rdx+028h] ; restore RSI - mov rbx, [rdx+030h] ; restore RBX - mov rbp, [rdx+038h] ; restore RBP - - mov r10, gs:[030h] ; load NT_TIB - mov rax, [rdx+050h] ; load stack base - mov [r10+08h], rax ; restore stack base - mov rax, [rdx+058h] ; load stack limit - mov [r10+010h], rax ; restore stack limit - mov rax, [rdx+060h] ; load fiber local storage - mov [r10+018h], rax ; restore fiber local storage - - mov rsp, [rdx+040h] ; restore RSP - mov r10, [rdx+048h] ; fetch the address to returned to - - mov rax, r8 ; use third arg as return value after jump - mov rcx, r8 ; use third arg as first arg in context function - - jmp r10 ; indirect jump to caller -jump_fcontext ENDP - -make_fcontext PROC EXPORT FRAME ; generate function table entry in .pdata and unwind information in E - .endprolog ; .xdata for a function's structured exception handling unwind behavior - - mov [rcx], rcx ; store the address of current context - mov [rcx+048h], rdx ; save the address of the function supposed to run - mov rdx, [rcx+050h] ; load the address where the context stack beginns - - push rcx ; save pointer to fcontext_t - sub rsp, 028h ; reserve shadow space for align_stack - mov rcx, rdx ; stack pointer as arg for align_stack - mov [rsp+8], rcx - call align_stack ; align stack - mov rdx, rax ; begin of aligned stack - add rsp, 028h - pop rcx ; restore pointer to fcontext_t - - lea rdx, [rdx-028h] ; reserve 32byte shadow space + return address on stack, (RSP + 8) % 16 == 0 - mov [rcx+040h], rdx ; save the address where the context stack beginns - - stmxcsr [rcx+068h] ; save MMX control and status word - fnstcw [rcx+06ch] ; save x87 control word - - lea rax, finish ; helper code executed after fn() returns - mov [rdx], rax ; store address off the helper function as return address - - xor rax, rax ; set RAX to zero - ret - -finish: - xor rcx, rcx - mov [rsp+08h], rcx - call _exit ; exit application - hlt -make_fcontext ENDP -END diff --git a/vendor/boost_1.51/libs/context/asm/fcontext_x86_64_sysv_elf_gas.S b/vendor/boost_1.51/libs/context/asm/fcontext_x86_64_sysv_elf_gas.S deleted file mode 100644 index ad2d42b..0000000 --- a/vendor/boost_1.51/libs/context/asm/fcontext_x86_64_sysv_elf_gas.S +++ /dev/null @@ -1,116 +0,0 @@ -/* - Copyright Oliver Kowalke 2009. - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or copy at - http://www.boost.org/LICENSE_1_0.txt) -*/ - -/**************************************************************************************** - * * - * ---------------------------------------------------------------------------------- * - * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * - * ---------------------------------------------------------------------------------- * - * | 0x0 | 0x4 | 0x8 | 0xc | 0x10 | 0x14 | 0x18 | 0x1c | * - * ---------------------------------------------------------------------------------- * - * | RBX | R12 | R13 | R14 | * - * ---------------------------------------------------------------------------------- * - * ---------------------------------------------------------------------------------- * - * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * - * ---------------------------------------------------------------------------------- * - * | 0x20 | 0x24 | 0x28 | 0x2c | 0x30 | 0x34 | 0x38 | 0x3c | * - * ---------------------------------------------------------------------------------- * - * | R15 | RBP | RSP | RIP | * - * ---------------------------------------------------------------------------------- * - * ---------------------------------------------------------------------------------- * - * | 16 | 17 | 18 | 19 | | * - * ---------------------------------------------------------------------------------- * - * | 0x40 | 0x44 | 0x48 | 0x4c | | * - * ---------------------------------------------------------------------------------- * - * | sbase | slimit | | * - * ---------------------------------------------------------------------------------- * - * ---------------------------------------------------------------------------------- * - * | 20 | 21 | | * - * ---------------------------------------------------------------------------------- * - * | 0x50 | 0x54 | | * - * ---------------------------------------------------------------------------------- * - * | fc_mxcsr|fc_x87_cw| | * - * ---------------------------------------------------------------------------------- * - * * - * **************************************************************************************/ - -.text -.globl jump_fcontext -.type jump_fcontext,@function -.align 16 -jump_fcontext: - movq %rbx, (%rdi) /* save RBX */ - movq %r12, 0x8(%rdi) /* save R12 */ - movq %r13, 0x10(%rdi) /* save R13 */ - movq %r14, 0x18(%rdi) /* save R14 */ - movq %r15, 0x20(%rdi) /* save R15 */ - movq %rbp, 0x28(%rdi) /* save RBP */ - - cmp $0, %rcx - je 1f - - stmxcsr 0x50(%rdi) /* save MMX control and status word */ - fnstcw 0x54(%rdi) /* save x87 control word */ - - ldmxcsr 0x50(%rsi) /* restore MMX control and status word */ - fldcw 0x54(%rsi) /* restore x87 control word */ -1: - - leaq 0x8(%rsp), %rax /* exclude the return address and save as stack pointer */ - movq %rax, 0x30(%rdi) /* save as stack pointer */ - movq (%rsp), %rax /* save return address */ - movq %rax, 0x38(%rdi) /* save return address as RIP */ - - movq (%rsi), %rbx /* restore RBX */ - movq 0x8(%rsi), %r12 /* restore R12 */ - movq 0x10(%rsi), %r13 /* restore R13 */ - movq 0x18(%rsi), %r14 /* restore R14 */ - movq 0x20(%rsi), %r15 /* restore R15 */ - movq 0x28(%rsi), %rbp /* restore RBP */ - - movq 0x30(%rsi), %rsp /* restore RSP */ - movq 0x38(%rsi), %rcx /* fetch the address to return to */ - - movq %rdx, %rax /* use third arg as return value after jump */ - movq %rdx, %rdi /* use third arg as first arg in context function */ - - jmp *%rcx /* indirect jump to context */ -.size jump_fcontext,.-jump_fcontext - -.text -.globl make_fcontext -.type make_fcontext,@function -.align 16 -make_fcontext: - movq %rdi, (%rdi) /* save the address of passed context */ - movq %rsi, 0x38(%rdi) /* save the address of the context function */ - movq 0x40(%rdi), %rdx /* load the stack base */ - - pushq %rdi /* save pointer to fcontext_t */ - movq %rdx, %rdi /* stack pointer as arg for align_stack */ - call align_stack@PLT /* align stack */ - movq %rax, %rdx /* begin of aligned stack */ - popq %rdi /* restore pointer to fcontext_t */ - - leaq -0x8(%rdx), %rdx /* reserve space for the last frame on stack, (RSP + 8) & 15 == 0 */ - movq %rdx, 0x30(%rdi) /* save the algined stack base */ - - stmxcsr 0x50(%rdi) /* save MMX control and status word */ - fnstcw 0x54(%rdi) /* save x87 control word */ - - leaq finish(%rip), %rcx /* address of finish; called after context function returns */ - movq %rcx, (%rdx) - - xorq %rax, %rax - ret - -finish: - xorq %rdi, %rdi /* exit code is zero */ - call _exit@PLT /* exit application */ - hlt -.size make_fcontext,.-make_fcontext - diff --git a/vendor/boost_1.51/libs/context/asm/fcontext_x86_64_sysv_macho_gas.S b/vendor/boost_1.51/libs/context/asm/fcontext_x86_64_sysv_macho_gas.S deleted file mode 100644 index eea76e4..0000000 --- a/vendor/boost_1.51/libs/context/asm/fcontext_x86_64_sysv_macho_gas.S +++ /dev/null @@ -1,111 +0,0 @@ -/* - Copyright Oliver Kowalke 2009. - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or copy at - http://www.boost.org/LICENSE_1_0.txt) -*/ - -/**************************************************************************************** - * * - * ---------------------------------------------------------------------------------- * - * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * - * ---------------------------------------------------------------------------------- * - * | 0x0 | 0x4 | 0x8 | 0xc | 0x10 | 0x14 | 0x18 | 0x1c | * - * ---------------------------------------------------------------------------------- * - * | RBX | R12 | R13 | R14 | * - * ---------------------------------------------------------------------------------- * - * ---------------------------------------------------------------------------------- * - * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * - * ---------------------------------------------------------------------------------- * - * | 0x20 | 0x24 | 0x28 | 0x2c | 0x30 | 0x34 | 0x38 | 0x3c | * - * ---------------------------------------------------------------------------------- * - * | R15 | RBP | RSP | RIP | * - * ---------------------------------------------------------------------------------- * - * ---------------------------------------------------------------------------------- * - * | 16 | 17 | 18 | 19 | | * - * ---------------------------------------------------------------------------------- * - * | 0x40 | 0x44 | 0x48 | 0x4c | | * - * ---------------------------------------------------------------------------------- * - * | sbase | slimit | | * - * ---------------------------------------------------------------------------------- * - * ---------------------------------------------------------------------------------- * - * | 20 | 21 | | * - * ---------------------------------------------------------------------------------- * - * | 0x50 | 0x54 | | * - * ---------------------------------------------------------------------------------- * - * | fc_mxcsr|fc_x87_cw| | * - * ---------------------------------------------------------------------------------- * - * * - * **************************************************************************************/ - -.text -.globl _jump_fcontext -.align 8 -_jump_fcontext: - movq %rbx, (%rdi) /* save RBX */ - movq %r12, 0x8(%rdi) /* save R12 */ - movq %r13, 0x10(%rdi) /* save R13 */ - movq %r14, 0x18(%rdi) /* save R14 */ - movq %r15, 0x20(%rdi) /* save R15 */ - movq %rbp, 0x28(%rdi) /* save RBP */ - - cmp $0, %rcx - je 1f - - stmxcsr 0x50(%rdi) /* save MMX control and status word */ - fnstcw 0x54(%rdi) /* save x87 control word */ - - ldmxcsr 0x50(%rsi) /* restore MMX control and status word */ - fldcw 0x54(%rsi) /* restore x87 control word */ -1: - - leaq 0x8(%rsp), %rax /* exclude the return address and save as stack pointer */ - movq %rax, 0x30(%rdi) /* save as stack pointer */ - movq (%rsp), %rax /* save return address */ - movq %rax, 0x38(%rdi) /* save return address as RIP */ - - movq (%rsi), %rbx /* restore RBX */ - movq 0x8(%rsi), %r12 /* restore R12 */ - movq 0x10(%rsi), %r13 /* restore R13 */ - movq 0x18(%rsi), %r14 /* restore R14 */ - movq 0x20(%rsi), %r15 /* restore R15 */ - movq 0x28(%rsi), %rbp /* restore RBP */ - - movq 0x30(%rsi), %rsp /* restore RSP */ - movq 0x38(%rsi), %rcx /* fetch the address to return to */ - - movq %rdx, %rax /* use third arg as return value after jump */ - movq %rdx, %rdi /* use third arg as first arg in context function */ - - jmp *%rcx /* indirect jump to context */ - -.text -.globl _make_fcontext -.align 8 -_make_fcontext: - movq %rdi, (%rdi) /* save the address of current context */ - movq %rsi, 0x38(%rdi) /* save the address of the function supposed to run */ - movq 0x40(%rdi), %rdx /* load the stack base */ - - pushq %rdi /* save pointer to fcontext_t */ - movq %rdx, %rdi /* stack pointer as arg for align_stack */ - call _align_stack /* align stack */ - movq %rax, %rdx /* begin of aligned stack */ - popq %rdi /* restore pointer to fcontext_t */ - - leaq -0x8(%rdx), %rdx /* reserve space for the last frame on stack, (RSP + 8) % 16 == 0 */ - movq %rdx, 0x30(%rdi) /* save the address */ - - stmxcsr 0x50(%rdi) /* save MMX control and status word */ - fnstcw 0x54(%rdi) /* save x87 control word */ - - leaq finish(%rip), %rcx /* helper code executed after context function returns */ - movq %rcx, (%rdx) - - xorq %rax, %rax /* set RAX to zero */ - ret - -finish: - xorq %rdi, %rdi /* exit code is zero */ - call _exit /* exit application */ - hlt diff --git a/vendor/boost_1.51/libs/context/fcontext.cpp b/vendor/boost_1.51/libs/context/fcontext.cpp deleted file mode 100644 index 596cbd8..0000000 --- a/vendor/boost_1.51/libs/context/fcontext.cpp +++ /dev/null @@ -1,36 +0,0 @@ - -// Copyright Oliver Kowalke 2009. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#define BOOST_CONTEXT_SOURCE - -#include - -#include - -#ifdef BOOST_HAS_ABI_HEADERS -# include BOOST_ABI_PREFIX -#endif - -namespace boost { -namespace ctx { -namespace detail { - -extern "C" BOOST_CONTEXT_DECL -void * BOOST_CONTEXT_CALLDECL align_stack( void * vp) -{ - void * base = vp; - if ( 0 != ( ( ( uintptr_t) base) & 15) ) - base = ( char * ) ( ( ( ( uintptr_t) base) - 15) & ~0x0F); - return base; -} - -} - -}} - -#ifdef BOOST_HAS_ABI_HEADERS -# include BOOST_ABI_SUFFIX -#endif diff --git a/vendor/boost_1.51/libs/context/seh.cpp b/vendor/boost_1.51/libs/context/seh.cpp deleted file mode 100644 index 9363805..0000000 --- a/vendor/boost_1.51/libs/context/seh.cpp +++ /dev/null @@ -1,83 +0,0 @@ - -// Copyright Oliver Kowalke 2009. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#define BOOST_CONTEXT_SOURCE - -extern "C" { - -#include -#include - -#include -#include -#include - -#if defined(_MSC_VER) -# define SNPRINTF _snprintf -#else -# define SNPRINTF snprintf -#endif - -static const char * exception_description( - _EXCEPTION_RECORD const* record, char * description, size_t len) -{ - const DWORD code = record->ExceptionCode; - const ULONG_PTR * info = record->ExceptionInformation; - - switch ( code) - { - case EXCEPTION_ACCESS_VIOLATION: - { - const char * accessType = ( info[0]) ? "writing" : "reading"; - const ULONG_PTR address = info[1]; - SNPRINTF( description, len, "Access violation %s %p", accessType, reinterpret_cast< void * >( address) ); - return description; - } - case EXCEPTION_DATATYPE_MISALIGNMENT: return "Datatype misalignment"; - case EXCEPTION_BREAKPOINT: return "Breakpoint"; - case EXCEPTION_SINGLE_STEP: return "Single step"; - case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: return "Array bounds exceeded"; - case EXCEPTION_FLT_DENORMAL_OPERAND: return "FPU denormal operand"; - case EXCEPTION_FLT_DIVIDE_BY_ZERO: return "FPU divide by zero"; - case EXCEPTION_FLT_INEXACT_RESULT: return "FPU inexact result"; - case EXCEPTION_FLT_INVALID_OPERATION: return "FPU invalid operation"; - case EXCEPTION_FLT_OVERFLOW: return "FPU overflow"; - case EXCEPTION_FLT_STACK_CHECK: return "FPU stack check"; - case EXCEPTION_FLT_UNDERFLOW: return "FPU underflow"; - case EXCEPTION_INT_DIVIDE_BY_ZERO: return "Integer divide by zero"; - case EXCEPTION_INT_OVERFLOW: return "Integer overflow"; - case EXCEPTION_PRIV_INSTRUCTION: return "Privileged instruction"; - case EXCEPTION_IN_PAGE_ERROR: return "In page error"; - case EXCEPTION_ILLEGAL_INSTRUCTION: return "Illegal instruction"; - case EXCEPTION_NONCONTINUABLE_EXCEPTION: return "Noncontinuable exception"; - case EXCEPTION_STACK_OVERFLOW: return "Stack overflow"; - case EXCEPTION_INVALID_DISPOSITION: return "Invalid disposition"; - case EXCEPTION_GUARD_PAGE: return "Guard page"; - case EXCEPTION_INVALID_HANDLE: return "Invalid handle"; - } - - SNPRINTF( description, len, "Unknown (0x%08lX)", code); - return description; -} - -EXCEPTION_DISPOSITION seh_fcontext( - struct _EXCEPTION_RECORD * record, - void *, - struct _CONTEXT *, - void *) -{ - char description[255]; - - fprintf( stderr, "exception: %s (%08lX)\n", - exception_description( record, description, sizeof( description) ), - record->ExceptionCode); - - ExitProcess( -1); - - return ExceptionContinueSearch; // never reached -} - -} diff --git a/vendor/boost_1.51/libs/context/stack_allocator_posix.cpp b/vendor/boost_1.51/libs/context/stack_allocator_posix.cpp deleted file mode 100644 index 64291e7..0000000 --- a/vendor/boost_1.51/libs/context/stack_allocator_posix.cpp +++ /dev/null @@ -1,85 +0,0 @@ - -// Copyright Oliver Kowalke 2009. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#define BOOST_CONTEXT_SOURCE - -#include - -extern "C" { -#include -#include -#include -#include -#include -} - -#include - -#include -#include -#include - -#include - -#ifdef BOOST_HAS_ABI_HEADERS -# include BOOST_ABI_PREFIX -#endif - -namespace boost { -namespace ctx { - -void * -stack_allocator::allocate( std::size_t size) const -{ - if ( minimum_stacksize() > size) - throw std::invalid_argument( - boost::str( boost::format("invalid stack size: must be at least %d bytes") - % minimum_stacksize() ) ); - - if ( ! is_stack_unbound() && ( maximum_stacksize() < size) ) - throw std::invalid_argument( - boost::str( boost::format("invalid stack size: must not be larger than %d bytes") - % maximum_stacksize() ) ); - - const std::size_t pages( page_count( size) + 1); // add +1 for guard page - std::size_t size_ = pages * pagesize(); - - -# if defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) - void * limit = ::mmap( 0, size_, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); -# else - const int fd( ::open("/dev/zero", O_RDONLY) ); - BOOST_ASSERT( -1 != fd); - void * limit = ::mmap( 0, size_, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); - ::close( fd); -# endif - if ( ! limit) throw std::bad_alloc(); - - const int result( ::mprotect( limit, pagesize(), PROT_NONE) ); - BOOST_ASSERT( 0 == result); - (void)result; // unused in release build - - return static_cast< char * >( limit) + size_; -} - -void -stack_allocator::deallocate( void * vp, std::size_t size) const -{ - if ( vp) - { - const std::size_t pages( page_count( size) + 1); // add +1 for guard page - std::size_t size_ = pages * pagesize(); - BOOST_ASSERT( 0 < size && 0 < size_); - void * limit = static_cast< char * >( vp) - size_; - ::munmap( limit, size_); - } -} - -}} - -#ifdef BOOST_HAS_ABI_HEADERS -# include BOOST_ABI_SUFFIX -#endif diff --git a/vendor/boost_1.51/libs/context/stack_allocator_windows.cpp b/vendor/boost_1.51/libs/context/stack_allocator_windows.cpp deleted file mode 100644 index 518239f..0000000 --- a/vendor/boost_1.51/libs/context/stack_allocator_windows.cpp +++ /dev/null @@ -1,86 +0,0 @@ - -// Copyright Oliver Kowalke 2009. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#define BOOST_CONTEXT_SOURCE - -#include - -extern "C" { -#include -} - -#include - -#include -#include -#include -#include - -#include - -#ifdef BOOST_HAS_ABI_HEADERS -# include BOOST_ABI_PREFIX -#endif - -# if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4244 4267) -# endif - -namespace boost { -namespace ctx { - -void * -stack_allocator::allocate( std::size_t size) const -{ - if ( minimum_stacksize() > size) - throw std::invalid_argument( - boost::str( boost::format("invalid stack size: must be at least %d bytes") - % minimum_stacksize() ) ); - - if ( ! is_stack_unbound() && ( maximum_stacksize() < size) ) - throw std::invalid_argument( - boost::str( boost::format("invalid stack size: must not be larger than %d bytes") - % maximum_stacksize() ) ); - - const std::size_t pages( page_count( size) + 1); // add +1 for guard page - std::size_t size_ = pages * pagesize(); - -#ifndef BOOST_CONTEXT_FIBER - void * limit = ::VirtualAlloc( 0, size_, MEM_COMMIT, PAGE_READWRITE); - if ( ! limit) throw std::bad_alloc(); - - DWORD old_options; - const BOOL result = ::VirtualProtect( - limit, pagesize(), PAGE_READWRITE | PAGE_GUARD /*PAGE_NOACCESS*/, & old_options); - BOOST_ASSERT( FALSE != result); - - return static_cast< char * >( limit) + size_; -#endif -} - -void -stack_allocator::deallocate( void * vp, std::size_t size) const -{ - if ( vp) - { - const std::size_t pages( page_count( size) + 1); // add +1 for guard page - std::size_t size_ = pages * pagesize(); - BOOST_ASSERT( 0 < size && 0 < size_); - void * limit = static_cast< char * >( vp) - size_; - ::VirtualFree( limit, 0, MEM_RELEASE); - } -} - -}} - -# if defined(BOOST_MSVC) -# pragma warning(pop) -# endif - -#ifdef BOOST_HAS_ABI_HEADERS -# include BOOST_ABI_SUFFIX -#endif diff --git a/vendor/boost_1.51/libs/context/stack_utils_posix.cpp b/vendor/boost_1.51/libs/context/stack_utils_posix.cpp deleted file mode 100644 index 13c4e4e..0000000 --- a/vendor/boost_1.51/libs/context/stack_utils_posix.cpp +++ /dev/null @@ -1,81 +0,0 @@ - -// Copyright Oliver Kowalke 2009. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#define BOOST_CONTEXT_SOURCE - -#include - -extern "C" { -#include -#include -#include -#include -} - -#include - -#include - -namespace { - -static rlimit stacksize_limit_() -{ - rlimit limit; - const int result = ::getrlimit( RLIMIT_STACK, & limit); - BOOST_ASSERT( 0 == result); - (void)result; // unused when in release mode... - return limit; -} - -static rlimit stacksize_limit() -{ - static rlimit limit = stacksize_limit_(); - return limit; -} - -} - -namespace boost { -namespace ctx { - -BOOST_CONTEXT_DECL -std::size_t default_stacksize() -{ - static std::size_t size = 256 * 1024; - return size; -} - -BOOST_CONTEXT_DECL -std::size_t minimum_stacksize() -{ return SIGSTKSZ; } - -BOOST_CONTEXT_DECL -std::size_t maximum_stacksize() -{ - BOOST_ASSERT( ! is_stack_unbound() ); - return static_cast< std::size_t >( stacksize_limit().rlim_max); -} - -BOOST_CONTEXT_DECL -bool is_stack_unbound() -{ return RLIM_INFINITY == stacksize_limit().rlim_max; } - -BOOST_CONTEXT_DECL -std::size_t pagesize() -{ - static std::size_t pagesize( ::getpagesize() ); - return pagesize; -} - -BOOST_CONTEXT_DECL -std::size_t page_count( std::size_t stacksize) -{ - return static_cast< std::size_t >( - std::ceil( - static_cast< float >( stacksize) / pagesize() ) ); -} - -}} diff --git a/vendor/boost_1.51/libs/context/stack_utils_windows.cpp b/vendor/boost_1.51/libs/context/stack_utils_windows.cpp deleted file mode 100644 index 373033d..0000000 --- a/vendor/boost_1.51/libs/context/stack_utils_windows.cpp +++ /dev/null @@ -1,84 +0,0 @@ - -// Copyright Oliver Kowalke 2009. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#define BOOST_CONTEXT_SOURCE - -#include - -extern "C" { -#include -} - -#include -#include - -#include - -namespace { - -static SYSTEM_INFO system_info_() -{ - SYSTEM_INFO si; - ::GetSystemInfo( & si); - return si; -} - -static SYSTEM_INFO system_info() -{ - static SYSTEM_INFO si = system_info_(); - return si; -} - -} - -namespace boost { -namespace ctx { - -BOOST_CONTEXT_DECL -std::size_t default_stacksize() -{ - static std::size_t size = 256 * 1024; - return size; -} - -BOOST_CONTEXT_DECL -std::size_t minimum_stacksize() -{ - static std::size_t stacksize( - static_cast< std::size_t >( system_info().dwAllocationGranularity) ); - return stacksize; -} - -BOOST_CONTEXT_DECL -std::size_t maximum_stacksize() -{ - BOOST_ASSERT( ! is_stack_unbound() ); - static std::size_t stacksize = 8 * 1024 * 1024; - return stacksize; -} - -// Windows seams not to provide a limit for the stacksize -BOOST_CONTEXT_DECL -bool is_stack_unbound() -{ return true; } - -BOOST_CONTEXT_DECL -std::size_t pagesize() -{ - static std::size_t pagesize( - static_cast< std::size_t >( system_info().dwPageSize) ); - return pagesize; -} - -BOOST_CONTEXT_DECL -std::size_t page_count( std::size_t stacksize) -{ - return static_cast< std::size_t >( - std::ceil( - static_cast< float >( stacksize) / pagesize() ) ); -} - -}} diff --git a/vendor/diff-match-patch-cpp-stl b/vendor/diff-match-patch-cpp-stl deleted file mode 160000 index 7f95b37..0000000 --- a/vendor/diff-match-patch-cpp-stl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7f95b37e554453262e2bcda830724fc362614103