From d436bcd12128f7df4b409e88f40e9ee92312f9ac Mon Sep 17 00:00:00 2001 From: "Kirk Shoop (MS OPEN TECH)" Date: Wed, 11 Dec 2013 15:10:53 -0800 Subject: [PATCH 01/10] detail changes for WinRT support --- include/boost/detail/winapi/system.hpp | 14 +++++++++++++- include/boost/detail/winapi/time.hpp | 10 ++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/include/boost/detail/winapi/system.hpp b/include/boost/detail/winapi/system.hpp index 35b6682..93c8398 100644 --- a/include/boost/detail/winapi/system.hpp +++ b/include/boost/detail/winapi/system.hpp @@ -1,6 +1,9 @@ // system.hpp --------------------------------------------------------------// // Copyright 2010 Vicente J. Botet Escriba +// Copyright Steve Gates 2013. +// Copyright George Mileka 2013. +// Portions Copyright (c) Microsoft Open Technologies, Inc. // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt @@ -20,7 +23,11 @@ namespace detail { namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) typedef ::SYSTEM_INFO SYSTEM_INFO_; - extern "C" __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *); +# if BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_WINXP +extern "C" __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *); +# else +extern "C" __declspec(dllimport) void __stdcall GetNativeSystemInfo (struct system_info *); +# endif #else extern "C" { typedef struct _SYSTEM_INFO { @@ -42,8 +49,13 @@ extern "C" { WORD_ wProcessorRevision; } SYSTEM_INFO_; +# if BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_WINXP __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *); +# else + __declspec(dllimport) void __stdcall + GetNativeSystemInfo (struct system_info *); +# endif } #endif } diff --git a/include/boost/detail/winapi/time.hpp b/include/boost/detail/winapi/time.hpp index b58df63..3f49599 100644 --- a/include/boost/detail/winapi/time.hpp +++ b/include/boost/detail/winapi/time.hpp @@ -1,6 +1,9 @@ // time.hpp --------------------------------------------------------------// // Copyright 2010 Vicente J. Botet Escriba +// Copyright Steve Gates 2013. +// Copyright George Mileka 2013. +// Portions Copyright (c) Microsoft Open Technologies, Inc. // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt @@ -31,10 +34,15 @@ namespace winapi { #ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime using ::GetSystemTimeAsFileTime; #endif + #ifndef BOOST_WINAPI_FAMILY using ::FileTimeToLocalFileTime; + #endif using ::GetSystemTime; using ::SystemTimeToFileTime; + + #ifndef BOOST_WINAPI_FAMILY using ::GetTickCount; + #endif #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 using ::GetTickCount64; #endif @@ -70,8 +78,10 @@ extern "C" { __declspec(dllimport) int WINAPI SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime, FILETIME_* lpFileTime); + #ifndef BOOST_WINAPI_FAMILY __declspec(dllimport) DWORD_ WINAPI GetTickCount(); + #endif #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 __declspec(dllimport) ULONGLONG_ WINAPI GetTickCount64(); From a46db5a32ea9ad25d9f3b87dc6a2cd39ee44040d Mon Sep 17 00:00:00 2001 From: Steve Gates Date: Tue, 15 Apr 2014 16:50:12 -0700 Subject: [PATCH 02/10] Removing MSOT copyright, replacing with Microsoft. --- include/boost/detail/winapi/system.hpp | 4 +--- include/boost/detail/winapi/time.hpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/boost/detail/winapi/system.hpp b/include/boost/detail/winapi/system.hpp index 93c8398..c68c379 100644 --- a/include/boost/detail/winapi/system.hpp +++ b/include/boost/detail/winapi/system.hpp @@ -1,9 +1,7 @@ // system.hpp --------------------------------------------------------------// // Copyright 2010 Vicente J. Botet Escriba -// Copyright Steve Gates 2013. -// Copyright George Mileka 2013. -// Portions Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Corporation // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt diff --git a/include/boost/detail/winapi/time.hpp b/include/boost/detail/winapi/time.hpp index 3f49599..751ba19 100644 --- a/include/boost/detail/winapi/time.hpp +++ b/include/boost/detail/winapi/time.hpp @@ -1,9 +1,7 @@ // time.hpp --------------------------------------------------------------// // Copyright 2010 Vicente J. Botet Escriba -// Copyright Steve Gates 2013. -// Copyright George Mileka 2013. -// Portions Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Corporation // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt From 78b061c1e1bae1cb63429c893061c3dfca6bcc1e Mon Sep 17 00:00:00 2001 From: Steve Gates Date: Tue, 13 May 2014 16:54:03 -0700 Subject: [PATCH 03/10] Updating macro for detecting WinRT to BOOST_WINDOWS_RUNTIME based on code review feedback. --- include/boost/detail/winapi/time.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/boost/detail/winapi/time.hpp b/include/boost/detail/winapi/time.hpp index 751ba19..09382a2 100644 --- a/include/boost/detail/winapi/time.hpp +++ b/include/boost/detail/winapi/time.hpp @@ -11,6 +11,7 @@ #define BOOST_DETAIL_WINAPI_TIME_HPP #include +#include #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once @@ -32,13 +33,13 @@ namespace winapi { #ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime using ::GetSystemTimeAsFileTime; #endif - #ifndef BOOST_WINAPI_FAMILY + #ifndef BOOST_WINDOWS_RUNTIME using ::FileTimeToLocalFileTime; #endif using ::GetSystemTime; using ::SystemTimeToFileTime; - #ifndef BOOST_WINAPI_FAMILY + #ifndef BOOST_WINDOWS_RUNTIME using ::GetTickCount; #endif #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 @@ -76,7 +77,7 @@ extern "C" { __declspec(dllimport) int WINAPI SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime, FILETIME_* lpFileTime); - #ifndef BOOST_WINAPI_FAMILY + #ifndef BOOST_WINDOWS_RUNTIME __declspec(dllimport) DWORD_ WINAPI GetTickCount(); #endif From b4e608fcf2397245bbb11955e5b2447dcc20e7a8 Mon Sep 17 00:00:00 2001 From: Steve Gates Date: Mon, 2 Jun 2014 12:16:56 -0700 Subject: [PATCH 04/10] Updating macro for detecting the Windows Runtime based on accepted changes adding a Boost.Predef. --- include/boost/detail/winapi/system.hpp | 2 +- include/boost/detail/winapi/time.hpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/boost/detail/winapi/system.hpp b/include/boost/detail/winapi/system.hpp index c68c379..2c2d82a 100644 --- a/include/boost/detail/winapi/system.hpp +++ b/include/boost/detail/winapi/system.hpp @@ -1,7 +1,7 @@ // system.hpp --------------------------------------------------------------// // Copyright 2010 Vicente J. Botet Escriba -// Copyright (c) Microsoft Corporation +// Copyright (c) Microsoft Corporation 2014 // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt diff --git a/include/boost/detail/winapi/time.hpp b/include/boost/detail/winapi/time.hpp index 09382a2..6a6b447 100644 --- a/include/boost/detail/winapi/time.hpp +++ b/include/boost/detail/winapi/time.hpp @@ -1,7 +1,7 @@ // time.hpp --------------------------------------------------------------// // Copyright 2010 Vicente J. Botet Escriba -// Copyright (c) Microsoft Corporation +// Copyright (c) Microsoft Corporation 2014 // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt @@ -33,13 +33,13 @@ namespace winapi { #ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime using ::GetSystemTimeAsFileTime; #endif - #ifndef BOOST_WINDOWS_RUNTIME + #if BOOST_PLAT_WINDOWS_DESKTOP using ::FileTimeToLocalFileTime; #endif using ::GetSystemTime; using ::SystemTimeToFileTime; - #ifndef BOOST_WINDOWS_RUNTIME + #if BOOST_PLAT_WINDOWS_DESKTOP using ::GetTickCount; #endif #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 @@ -77,7 +77,7 @@ extern "C" { __declspec(dllimport) int WINAPI SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime, FILETIME_* lpFileTime); - #ifndef BOOST_WINDOWS_RUNTIME + #if BOOST_PLAT_WINDOWS_DESKTOP __declspec(dllimport) DWORD_ WINAPI GetTickCount(); #endif From 83be62c6c11d25e4aab1cdb88267779eda54348d Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 4 Jun 2014 12:57:45 +0400 Subject: [PATCH 05/10] The file has been moved to Boost.Core. --- .../boost/detail/scoped_enum_emulation.hpp | 337 ------------------ 1 file changed, 337 deletions(-) delete mode 100644 include/boost/detail/scoped_enum_emulation.hpp diff --git a/include/boost/detail/scoped_enum_emulation.hpp b/include/boost/detail/scoped_enum_emulation.hpp deleted file mode 100644 index d266e0e..0000000 --- a/include/boost/detail/scoped_enum_emulation.hpp +++ /dev/null @@ -1,337 +0,0 @@ -// scoped_enum_emulation.hpp ---------------------------------------------------------// - -// Copyright Beman Dawes, 2009 -// Copyright (C) 2011-2012 Vicente J. Botet Escriba -// Copyright (C) 2012 Anthony Williams - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - -/* -[section:scoped_enums Scoped Enums] - -Generates C++0x scoped enums if the feature is present, otherwise emulates C++0x -scoped enums with C++03 namespaces and enums. The Boost.Config BOOST_NO_CXX11_SCOPED_ENUMS -macro is used to detect feature support. - -See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf for a -description of the scoped enum feature. Note that the committee changed the name -from strongly typed enum to scoped enum. - -Some of the enumerations defined in the standard library are scoped enums. - - enum class future_errc - { - broken_promise, - future_already_retrieved, - promise_already_satisfied, - no_state - }; - -On compilers that don't support them, the library provides two emulations: - -[heading Strict] - -* Able to specify the underlying type. -* explicit conversion to/from underlying type. -* The wrapper is not a C++03 enum type. - -The user can declare declare these types as - - BOOST_SCOPED_ENUM_DECLARE_BEGIN(future_errc) - { - broken_promise, - future_already_retrieved, - promise_already_satisfied, - no_state - } - BOOST_SCOPED_ENUM_DECLARE_END(future_errc) - -These macros allows to use 'future_errc' in almost all the cases as an scoped enum. - - future_errc err = future_errc::no_state; - -There are however some limitations: - -* The type is not a C++ enum, so 'is_enum' will be false_type. -* The emulated scoped enum can not be used in switch nor in template arguments. For these cases the user needs to use some macros. - -Instead of - - switch (ev) - { - case future_errc::broken_promise: - // ... - -use - - switch (boost::native_value(ev)) - { - case future_errc::broken_promise: - -And instead of - - #ifdef BOOST_NO_CXX11_SCOPED_ENUMS - template <> - struct BOOST_SYMBOL_VISIBLE is_error_code_enum : public true_type { }; - #endif - -use - - #ifdef BOOST_NO_CXX11_SCOPED_ENUMS - template <> - struct BOOST_SYMBOL_VISIBLE is_error_code_enum : public true_type { }; - #endif - - -Sample usage: - - BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(algae, char) { green, red, cyan }; BOOST_SCOPED_ENUM_DECLARE_END(algae) - ... - algae sample( algae::red ); - void foo( algae color ); - ... - sample = algae::green; - foo( algae::cyan ); - - Light - Caution: only the syntax is emulated; the semantics are not emulated and - the syntax emulation doesn't include being able to specify the underlying - representation type. - - The literal scoped emulation is via struct rather than namespace to allow use within classes. - Thanks to Andrey Semashev for pointing that out. - However the type is an real C++03 enum and so convertible implicitly to an int. - - Sample usage: - - BOOST_SCOPED_ENUM_START(algae) { green, red, cyan }; BOOST_SCOPED_ENUM_END - ... - BOOST_SCOPED_ENUM(algae) sample( algae::red ); - void foo( BOOST_SCOPED_ENUM(algae) color ); - ... - sample = algae::green; - foo( algae::cyan ); - - Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott, - Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, Matt Calabrese, Vicente - Botet, and Daniel James. - -[endsect] -*/ - - -#ifndef BOOST_SCOPED_ENUM_EMULATION_HPP -#define BOOST_SCOPED_ENUM_EMULATION_HPP - -#include -#include - -namespace boost -{ - -#ifdef BOOST_NO_CXX11_SCOPED_ENUMS - /** - * Meta-function to get the underlying type of a scoped enum. - * - * Requires EnumType must be an enum type or the emulation of a scoped enum - */ - template - struct underlying_type - { - /** - * The member typedef type names the underlying type of EnumType. It is EnumType::underlying_type when the EnumType is an emulated scoped enum, - * std::underlying_type::type when the standard library std::underlying_type is provided. - * - * The user will need to specialize it when the compiler supports scoped enums but don't provides std::underlying_type. - */ - typedef typename EnumType::underlying_type type; - }; - - /** - * Meta-function to get the native enum type associated to an enum class or its emulation. - */ - template - struct native_type - { - /** - * The member typedef type names the native enum type associated to the scoped enum, - * which is it self if the compiler supports scoped enums or EnumType::enum_type if it is an emulated scoped enum. - */ - typedef typename EnumType::enum_type type; - }; - - /** - * Casts a scoped enum to its underlying type. - * - * This function is useful when working with scoped enum classes, which doens't implicitly convert to the underlying type. - * @param v A scoped enum. - * @returns The underlying type. - * @throws No-throws. - */ - template - UnderlyingType underlying_cast(EnumType v) - { - return v.get_underlying_value_(); - } - - /** - * Casts a scoped enum to its native enum type. - * - * This function is useful to make programs portable when the scoped enum emulation can not be use where native enums can. - * - * EnumType the scoped enum type - * - * @param v A scoped enum. - * @returns The native enum value. - * @throws No-throws. - */ - template - inline - typename EnumType::enum_type native_value(EnumType e) - { - return e.native_value_(); - } - -#else // BOOST_NO_CXX11_SCOPED_ENUMS - - template - struct underlying_type - { - //typedef typename std::underlying_type::type type; - }; - - template - struct native_type - { - typedef EnumType type; - }; - - template - UnderlyingType underlying_cast(EnumType v) - { - return static_cast(v); - } - - template - inline - EnumType native_value(EnumType e) - { - return e; - } - -#endif -} - - -#ifdef BOOST_NO_CXX11_SCOPED_ENUMS - -#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS - -#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \ - explicit operator underlying_type() const { return get_underlying_value_(); } - -#else - -#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR - -#endif - -/** - * Start a declaration of a scoped enum. - * - * @param EnumType The new scoped enum. - * @param UnderlyingType The underlying type. - */ -#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType, UnderlyingType) \ - struct EnumType { \ - typedef UnderlyingType underlying_type; \ - EnumType() BOOST_NOEXCEPT {} \ - explicit EnumType(underlying_type v) : v_(v) {} \ - underlying_type get_underlying_value_() const { return v_; } \ - BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \ - private: \ - underlying_type v_; \ - typedef EnumType self_type; \ - public: \ - enum enum_type - -#define BOOST_SCOPED_ENUM_DECLARE_END2() \ - enum_type get_native_value_() const BOOST_NOEXCEPT { return enum_type(v_); } \ - operator enum_type() const BOOST_NOEXCEPT { return get_native_value_(); } \ - friend bool operator ==(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==enum_type(rhs.v_); } \ - friend bool operator ==(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==rhs; } \ - friend bool operator ==(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs==enum_type(rhs.v_); } \ - friend bool operator !=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=enum_type(rhs.v_); } \ - friend bool operator !=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=rhs; } \ - friend bool operator !=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs!=enum_type(rhs.v_); } \ - friend bool operator <(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>enum_type(rhs.v_); } \ - friend bool operator >(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>rhs; } \ - friend bool operator >(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>enum_type(rhs.v_); } \ - friend bool operator >=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=enum_type(rhs.v_); } \ - friend bool operator >=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=rhs; } \ - friend bool operator >=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>=enum_type(rhs.v_); } \ - }; - -#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) \ - ; \ - EnumType(enum_type v) BOOST_NOEXCEPT : v_(v) {} \ - BOOST_SCOPED_ENUM_DECLARE_END2() - -/** - * Starts a declaration of a scoped enum with the default int underlying type. - * - * @param EnumType The new scoped enum. - */ -#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) \ - BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,int) - -/** - * Name of the native enum type. - * - * @param NT The new scoped enum. - */ -#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType::enum_type -/** - * Forward declares an scoped enum. - * - * @param NT The scoped enum. - */ -#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) struct EnumType - -#else // BOOST_NO_CXX11_SCOPED_ENUMS - -#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,UnderlyingType) enum class EnumType:UnderlyingType -#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) enum class EnumType -#define BOOST_SCOPED_ENUM_DECLARE_END2() -#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) ; - -#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType -#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) enum class EnumType - -#endif // BOOST_NO_CXX11_SCOPED_ENUMS - -#define BOOST_SCOPED_ENUM_START(name) BOOST_SCOPED_ENUM_DECLARE_BEGIN(name) -#define BOOST_SCOPED_ENUM_END BOOST_SCOPED_ENUM_DECLARE_END2() -#define BOOST_SCOPED_ENUM(name) BOOST_SCOPED_ENUM_NATIVE(name) - -//#ifdef BOOST_NO_CXX11_SCOPED_ENUMS -// -//# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_type -//# define BOOST_SCOPED_ENUM_END }; -//# define BOOST_SCOPED_ENUM(name) name::enum_type -// -//#else -// -//# define BOOST_SCOPED_ENUM_START(name) enum class name -//# define BOOST_SCOPED_ENUM_END -//# define BOOST_SCOPED_ENUM(name) name -// -//#endif -#endif // BOOST_SCOPED_ENUM_EMULATION_HPP From a9cc3926de36586473a7fa964dd8ad909b6fbc6e Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 4 Jun 2014 13:02:28 +0400 Subject: [PATCH 06/10] Removed executable attribute. --- include/boost/indirect_reference.hpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 include/boost/indirect_reference.hpp diff --git a/include/boost/indirect_reference.hpp b/include/boost/indirect_reference.hpp old mode 100755 new mode 100644 From 96633200368fe1930b1402326ef23d7ea8a63988 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 5 Jun 2014 01:39:51 +0300 Subject: [PATCH 07/10] Remove indirect_reference.hpp, it has been moved to iterator. --- include/boost/indirect_reference.hpp | 43 ---------------------------- 1 file changed, 43 deletions(-) delete mode 100644 include/boost/indirect_reference.hpp diff --git a/include/boost/indirect_reference.hpp b/include/boost/indirect_reference.hpp deleted file mode 100644 index 5fbb342..0000000 --- a/include/boost/indirect_reference.hpp +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef INDIRECT_REFERENCE_DWA200415_HPP -# define INDIRECT_REFERENCE_DWA200415_HPP - -// -// Copyright David Abrahams 2004. Use, modification and distribution is -// subject to the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// typename indirect_reference

::type provides the type of *p. -// -// http://www.boost.org/libs/iterator/doc/pointee.html -// - -# include -# include -# include -# include -# include - -namespace boost { - -namespace detail -{ - template - struct smart_ptr_reference - { - typedef typename boost::pointee

::type& type; - }; -} - -template -struct indirect_reference - : mpl::eval_if< - detail::is_incrementable

- , iterator_reference

- , detail::smart_ptr_reference

- > -{ -}; - -} // namespace boost - -#endif // INDIRECT_REFERENCE_DWA200415_HPP From 5cdcab8b51fca1940e4e44aa36a597b58509ef97 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 5 Jun 2014 17:51:49 +0300 Subject: [PATCH 08/10] Remove detail/endian.hpp, moved to predef. --- include/boost/detail/endian.hpp | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 include/boost/detail/endian.hpp diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp deleted file mode 100644 index 3e37db9..0000000 --- a/include/boost/detail/endian.hpp +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2013 Redshift Software Inc -// Distributed under the Boost Software License, Version 1.0. (See accompany- -// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_DETAIL_ENDIAN_HPP -#define BOOST_DETAIL_ENDIAN_HPP - -// Use the Predef library for the detection of endianess. -#include - -#endif From 05fecc6e3e8161cd08abba99c70baf49287f82d8 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 5 Jun 2014 23:18:28 +0400 Subject: [PATCH 09/10] The files were moved to Boost.WinAPI submodule. --- .../boost/detail/winapi/GetCurrentProcess.hpp | 29 -- .../boost/detail/winapi/GetCurrentThread.hpp | 38 --- include/boost/detail/winapi/GetLastError.hpp | 31 -- .../boost/detail/winapi/GetProcessTimes.hpp | 39 --- .../boost/detail/winapi/GetThreadTimes.hpp | 37 --- include/boost/detail/winapi/LocalFree.hpp | 33 -- include/boost/detail/winapi/basic_types.hpp | 134 -------- include/boost/detail/winapi/config.hpp | 53 ---- .../detail/winapi/directory_management.hpp | 46 --- include/boost/detail/winapi/dll.hpp | 86 ----- .../boost/detail/winapi/error_handling.hpp | 93 ------ .../boost/detail/winapi/file_management.hpp | 130 -------- include/boost/detail/winapi/handles.hpp | 46 --- include/boost/detail/winapi/memory.hpp | 60 ---- include/boost/detail/winapi/process.hpp | 36 --- include/boost/detail/winapi/security.hpp | 65 ---- .../boost/detail/winapi/synchronization.hpp | 293 ------------------ include/boost/detail/winapi/system.hpp | 62 ---- include/boost/detail/winapi/thread.hpp | 49 --- include/boost/detail/winapi/thread_pool.hpp | 96 ------ include/boost/detail/winapi/time.hpp | 105 ------- include/boost/detail/winapi/timers.hpp | 44 --- include/boost/detail/winapi/tls.hpp | 49 --- .../boost/detail/winapi/waitable_timer.hpp | 110 ------- 24 files changed, 1764 deletions(-) delete mode 100644 include/boost/detail/winapi/GetCurrentProcess.hpp delete mode 100644 include/boost/detail/winapi/GetCurrentThread.hpp delete mode 100644 include/boost/detail/winapi/GetLastError.hpp delete mode 100644 include/boost/detail/winapi/GetProcessTimes.hpp delete mode 100644 include/boost/detail/winapi/GetThreadTimes.hpp delete mode 100644 include/boost/detail/winapi/LocalFree.hpp delete mode 100644 include/boost/detail/winapi/basic_types.hpp delete mode 100644 include/boost/detail/winapi/config.hpp delete mode 100644 include/boost/detail/winapi/directory_management.hpp delete mode 100644 include/boost/detail/winapi/dll.hpp delete mode 100644 include/boost/detail/winapi/error_handling.hpp delete mode 100644 include/boost/detail/winapi/file_management.hpp delete mode 100644 include/boost/detail/winapi/handles.hpp delete mode 100644 include/boost/detail/winapi/memory.hpp delete mode 100644 include/boost/detail/winapi/process.hpp delete mode 100644 include/boost/detail/winapi/security.hpp delete mode 100644 include/boost/detail/winapi/synchronization.hpp delete mode 100644 include/boost/detail/winapi/system.hpp delete mode 100644 include/boost/detail/winapi/thread.hpp delete mode 100644 include/boost/detail/winapi/thread_pool.hpp delete mode 100644 include/boost/detail/winapi/time.hpp delete mode 100644 include/boost/detail/winapi/timers.hpp delete mode 100644 include/boost/detail/winapi/tls.hpp delete mode 100644 include/boost/detail/winapi/waitable_timer.hpp diff --git a/include/boost/detail/winapi/GetCurrentProcess.hpp b/include/boost/detail/winapi/GetCurrentProcess.hpp deleted file mode 100644 index 51206bb..0000000 --- a/include/boost/detail/winapi/GetCurrentProcess.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// GetCurrentProcess.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP -#define BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost { -namespace detail { -namespace winapi { -#if defined( BOOST_USE_WINDOWS_H ) - using ::GetCurrentProcess; -#else - extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentProcess(); -#endif -} -} -} -#endif // BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP diff --git a/include/boost/detail/winapi/GetCurrentThread.hpp b/include/boost/detail/winapi/GetCurrentThread.hpp deleted file mode 100644 index 595b751..0000000 --- a/include/boost/detail/winapi/GetCurrentThread.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// GetCurrentThread.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP -#define BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost { -namespace detail { -namespace winapi { -#if defined( UNDER_CE ) -// Windows CE define GetCurrentThread as an inline function in kfuncs.h -inline HANDLE_ GetCurrentThread() -{ - return ::GetCurrentThread(); -} -#else -#if defined( BOOST_USE_WINDOWS_H ) - using ::GetCurrentThread; -#else - extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentThread(); -#endif -#endif -} -} -} - -#endif // BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP diff --git a/include/boost/detail/winapi/GetLastError.hpp b/include/boost/detail/winapi/GetLastError.hpp deleted file mode 100644 index 6e9e2d9..0000000 --- a/include/boost/detail/winapi/GetLastError.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// GetLastError.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_GETLASTERROR_HPP -#define BOOST_DETAIL_WINAPI_GETLASTERROR_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost { -namespace detail { -namespace winapi { -#if defined( BOOST_USE_WINDOWS_H ) - using ::GetLastError; -#else - extern "C" __declspec(dllimport) DWORD_ WINAPI - GetLastError(); -#endif -} -} -} - -#endif // BOOST_DETAIL_WINAPI_GETLASTERROR_HPP diff --git a/include/boost/detail/winapi/GetProcessTimes.hpp b/include/boost/detail/winapi/GetProcessTimes.hpp deleted file mode 100644 index f2860b0..0000000 --- a/include/boost/detail/winapi/GetProcessTimes.hpp +++ /dev/null @@ -1,39 +0,0 @@ -// GetProcessTimes.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP -#define BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost { -namespace detail { -namespace winapi { -#if !defined(UNDER_CE) // Windows CE does not define GetProcessTimes -#if defined( BOOST_USE_WINDOWS_H ) - using ::GetProcessTimes; -#else - extern "C" __declspec(dllimport) BOOL_ WINAPI - GetProcessTimes( - HANDLE_ hProcess, - LPFILETIME_ lpCreationTime, - LPFILETIME_ lpExitTime, - LPFILETIME_ lpKernelTime, - LPFILETIME_ lpUserTime - ); -#endif -#endif -} -} -} - -#endif // BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP diff --git a/include/boost/detail/winapi/GetThreadTimes.hpp b/include/boost/detail/winapi/GetThreadTimes.hpp deleted file mode 100644 index 3428eda..0000000 --- a/include/boost/detail/winapi/GetThreadTimes.hpp +++ /dev/null @@ -1,37 +0,0 @@ -// GetThreadTimes.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP -#define BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost { -namespace detail { -namespace winapi { -#if defined( BOOST_USE_WINDOWS_H ) - using ::GetThreadTimes; -#else - extern "C" __declspec(dllimport) BOOL_ WINAPI - GetThreadTimes( - HANDLE_ hThread, - LPFILETIME_ lpCreationTime, - LPFILETIME_ lpExitTime, - LPFILETIME_ lpKernelTime, - LPFILETIME_ lpUserTime - ); -#endif -} -} -} - -#endif // BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP diff --git a/include/boost/detail/winapi/LocalFree.hpp b/include/boost/detail/winapi/LocalFree.hpp deleted file mode 100644 index 697016c..0000000 --- a/include/boost/detail/winapi/LocalFree.hpp +++ /dev/null @@ -1,33 +0,0 @@ -// LocalFree.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_LOCALFREE_HPP -#define BOOST_DETAIL_WINAPI_LOCALFREE_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost { -namespace detail { -namespace winapi { -#if defined( BOOST_USE_WINDOWS_H ) - typedef HANDLE_ HLOCAL_; - - using ::LocalFree; -#else - extern "C" typedef HANDLE_ HLOCAL_; - extern "C" __declspec(dllimport) HLOCAL_ WINAPI - LocalFree(HLOCAL_ hMem); -#endif -} -} -} -#endif // BOOST_DETAIL_WINAPI_LOCALFREE_HPP diff --git a/include/boost/detail/winapi/basic_types.hpp b/include/boost/detail/winapi/basic_types.hpp deleted file mode 100644 index 09d907b..0000000 --- a/include/boost/detail/winapi/basic_types.hpp +++ /dev/null @@ -1,134 +0,0 @@ -// basic_types.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP -#define BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP - -#include -#include -#include - -#if defined( BOOST_USE_WINDOWS_H ) -# include -#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__) -# include -// @FIXME Which condition must be tested -# ifdef UNDER_CE -# ifndef WINAPI -# ifndef _WIN32_WCE_EMULATION -# define WINAPI __cdecl // Note this doesn't match the desktop definition -# else -# define WINAPI __stdcall -# endif -# endif -# else -# ifndef WINAPI -# define WINAPI __stdcall -# endif -# endif -# ifndef NTAPI -# define NTAPI __stdcall -# endif -#else -# error "Win32 functions not available" -#endif - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost { -namespace detail { -namespace winapi { -#if defined( BOOST_USE_WINDOWS_H ) - typedef ::BOOL BOOL_; - typedef ::BOOLEAN BOOLEAN_; - typedef ::PBOOLEAN PBOOLEAN_; - typedef ::BYTE BYTE_; - typedef ::WORD WORD_; - typedef ::DWORD DWORD_; - typedef ::HANDLE HANDLE_; - typedef ::HMODULE HMODULE_; - typedef ::LONG LONG_; - typedef ::ULONG ULONG_; - typedef ::LONGLONG LONGLONG_; - typedef ::ULONGLONG ULONGLONG_; - typedef ::INT_PTR INT_PTR_; - typedef ::UINT_PTR UINT_PTR_; - typedef ::LONG_PTR LONG_PTR_; - typedef ::ULONG_PTR ULONG_PTR_; - typedef ::LARGE_INTEGER LARGE_INTEGER_; - typedef ::PLARGE_INTEGER PLARGE_INTEGER_; - typedef ::PVOID PVOID_; - typedef ::LPVOID LPVOID_; - typedef ::CHAR CHAR_; - typedef ::LPSTR LPSTR_; - typedef ::LPCSTR LPCSTR_; - typedef ::WCHAR WCHAR_; - typedef ::LPWSTR LPWSTR_; - typedef ::LPCWSTR LPCWSTR_; -#else -extern "C" { - typedef int BOOL_; - typedef unsigned char BYTE_; - typedef BYTE_ BOOLEAN_; - typedef BOOLEAN_* PBOOLEAN_; - typedef unsigned short WORD_; - typedef unsigned long DWORD_; - typedef void* HANDLE_; - typedef void* HMODULE_; - - typedef long LONG_; - typedef unsigned long ULONG_; - - typedef boost::int64_t LONGLONG_; - typedef boost::uint64_t ULONGLONG_; - -// @FIXME Which condition must be tested -# ifdef _WIN64 -#if defined(__CYGWIN__) - typedef long INT_PTR_; - typedef unsigned long UINT_PTR_; - typedef long LONG_PTR_; - typedef unsigned long ULONG_PTR_; -#else - typedef __int64 INT_PTR_; - typedef unsigned __int64 UINT_PTR_; - typedef __int64 LONG_PTR_; - typedef unsigned __int64 ULONG_PTR_; -#endif -# else - typedef int INT_PTR_; - typedef unsigned int UINT_PTR_; - typedef long LONG_PTR_; - typedef unsigned long ULONG_PTR_; -# endif - - typedef struct _LARGE_INTEGER { - LONGLONG_ QuadPart; - } LARGE_INTEGER_; - typedef LARGE_INTEGER_ *PLARGE_INTEGER_; - - typedef void *PVOID_; - typedef void *LPVOID_; - typedef const void *LPCVOID_; - - typedef char CHAR_; - typedef CHAR_ *LPSTR_; - typedef const CHAR_ *LPCSTR_; - - typedef wchar_t WCHAR_; - typedef WCHAR_ *LPWSTR_; - typedef const WCHAR_ *LPCWSTR_; -} -#endif -} -} -} - -#endif // BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP diff --git a/include/boost/detail/winapi/config.hpp b/include/boost/detail/winapi/config.hpp deleted file mode 100644 index 2b0cdfb..0000000 --- a/include/boost/detail/winapi/config.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// config.hpp --------------------------------------------------------------// - -// Copyright 2013 Andrey Semashev - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_ -#define BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_ - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -// These constants reflect _WIN32_WINNT_* macros from sdkddkver.h -// See also: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745%28v=vs.85%29.aspx#setting_winver_or__win32_winnt -#define BOOST_WINAPI_VERSION_NT4 0x0400 -#define BOOST_WINAPI_VERSION_WIN2K 0x0500 -#define BOOST_WINAPI_VERSION_WINXP 0x0501 -#define BOOST_WINAPI_VERSION_WS03 0x0502 -#define BOOST_WINAPI_VERSION_WIN6 0x0600 -#define BOOST_WINAPI_VERSION_VISTA 0x0600 -#define BOOST_WINAPI_VERSION_WS08 0x0600 -#define BOOST_WINAPI_VERSION_LONGHORN 0x0600 -#define BOOST_WINAPI_VERSION_WIN7 0x0601 -#define BOOST_WINAPI_VERSION_WIN8 0x0602 -#define BOOST_WINAPI_VERSION_WINBLUE 0x0603 - -#if !defined(BOOST_USE_WINAPI_VERSION) -#if defined(_WIN32_WINNT) -#define BOOST_USE_WINAPI_VERSION _WIN32_WINNT -#elif defined(WINVER) -#define BOOST_USE_WINAPI_VERSION WINVER -#else -// By default use Windows XP API -#define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WINXP -#endif -#endif - -#if defined(BOOST_USE_WINDOWS_H) -// We have to define the version macros so that windows.h provides the necessary symbols -#if !defined(_WIN32_WINNT) -#define _WIN32_WINNT BOOST_USE_WINAPI_VERSION -#endif -#if !defined(WINVER) -#define WINVER BOOST_USE_WINAPI_VERSION -#endif -#endif - -#endif // BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_ diff --git a/include/boost/detail/winapi/directory_management.hpp b/include/boost/detail/winapi/directory_management.hpp deleted file mode 100644 index 19af1ee..0000000 --- a/include/boost/detail/winapi/directory_management.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// directory_management.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP -#define BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP - -#include -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost -{ -namespace detail -{ -namespace winapi -{ -#if defined( BOOST_USE_WINDOWS_H ) - using ::CreateDirectory; - using ::CreateDirectoryA; - using ::GetTempPathA; - using ::RemoveDirectoryA; -#else -extern "C" { - __declspec(dllimport) int __stdcall - CreateDirectory(LPCTSTR_, LPSECURITY_ATTRIBUTES_*); - __declspec(dllimport) int __stdcall - CreateDirectoryA(LPCTSTR_, interprocess_security_attributes*); - __declspec(dllimport) int __stdcall - GetTempPathA(unsigned long length, char *buffer); - __declspec(dllimport) int __stdcall - RemoveDirectoryA(LPCTSTR_); -} -#endif -} -} -} - -#endif // BOOST_DETAIL_WINAPI_THREAD_HPP diff --git a/include/boost/detail/winapi/dll.hpp b/include/boost/detail/winapi/dll.hpp deleted file mode 100644 index 2ec5a73..0000000 --- a/include/boost/detail/winapi/dll.hpp +++ /dev/null @@ -1,86 +0,0 @@ -// dll.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_DLL_HPP -#define BOOST_DETAIL_WINAPI_DLL_HPP - -#include -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost -{ -namespace detail -{ -namespace winapi -{ -#if defined( BOOST_USE_WINDOWS_H ) - typedef ::FARPROC FARPROC_; - typedef ::NEARPROC NEARPROC_; - typedef ::PROC PROC_; - -# ifdef BOOST_NO_ANSI_APIS - using ::LoadLibraryW; - using ::GetModuleHandleW; -# else - using ::LoadLibraryA; - using ::GetModuleHandleA; -# endif - using ::FreeLibrary; - using ::GetProcAddress; -#else -extern "C" { -# ifdef _WIN64 - typedef INT_PTR_ (WINAPI *FARPROC_)(); - typedef INT_PTR_ (WINAPI *NEARPROC_)(); - typedef INT_PTR_ (WINAPI *PROC_)(); -# else - typedef int (WINAPI *FARPROC_)(); - typedef int (WINAPI *NEARPROC_)(); - typedef int (WINAPI *PROC_)(); -# endif // _WIN64 - -# ifdef BOOST_NO_ANSI_APIS - __declspec(dllimport) HMODULE_ WINAPI - LoadLibraryW( - LPCWSTR_ lpFileName - ); - __declspec(dllimport) HMODULE_ WINAPI - GetModuleHandleW( - LPCWSTR_ lpFileName - ); -# else - __declspec(dllimport) HMODULE_ WINAPI - LoadLibraryA( - LPCSTR_ lpFileName - ); - __declspec(dllimport) HMODULE_ WINAPI - GetModuleHandleA( - LPCSTR_ lpFileName - ); -# endif - - __declspec(dllimport) BOOL_ WINAPI - FreeLibrary( - HMODULE_ hModule - ); - __declspec(dllimport) FARPROC_ WINAPI - GetProcAddress( - HMODULE_ hModule, - LPCSTR_ lpProcName - ); -} -#endif -} -} -} - -#endif // BOOST_DETAIL_WINAPI_DLL_HPP diff --git a/include/boost/detail/winapi/error_handling.hpp b/include/boost/detail/winapi/error_handling.hpp deleted file mode 100644 index fbe9924..0000000 --- a/include/boost/detail/winapi/error_handling.hpp +++ /dev/null @@ -1,93 +0,0 @@ -// error_handling.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP -#define BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP - -#include -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost { -namespace detail { -namespace winapi { - -#if defined( BOOST_USE_WINDOWS_H ) - using ::FormatMessageA; - using ::FormatMessageW; - - const int FORMAT_MESSAGE_ALLOCATE_BUFFER_= FORMAT_MESSAGE_ALLOCATE_BUFFER; - const int FORMAT_MESSAGE_IGNORE_INSERTS_= FORMAT_MESSAGE_IGNORE_INSERTS; - const int FORMAT_MESSAGE_FROM_STRING_= FORMAT_MESSAGE_FROM_STRING; - const int FORMAT_MESSAGE_FROM_HMODULE_= FORMAT_MESSAGE_FROM_HMODULE; - const int FORMAT_MESSAGE_FROM_SYSTEM_= FORMAT_MESSAGE_FROM_SYSTEM; - const int FORMAT_MESSAGE_ARGUMENT_ARRAY_= FORMAT_MESSAGE_ARGUMENT_ARRAY; - const int FORMAT_MESSAGE_MAX_WIDTH_MASK_= FORMAT_MESSAGE_MAX_WIDTH_MASK; - - const char LANG_NEUTRAL_= LANG_NEUTRAL; - const char LANG_INVARIANT_= LANG_INVARIANT; - - const char SUBLANG_DEFAULT_= SUBLANG_DEFAULT; // user default - inline WORD_ MAKELANGID_(WORD_ p, WORD_ s) { - return MAKELANGID(p,s); - } -#else -extern "C" { - // using ::FormatMessageA; - __declspec(dllimport) - DWORD_ - WINAPI - FormatMessageA( - DWORD_ dwFlags, - LPCVOID_ lpSource, - DWORD_ dwMessageId, - DWORD_ dwLanguageId, - LPSTR_ lpBuffer, - DWORD_ nSize, - va_list *Arguments - ); - - // using ::FormatMessageW; - __declspec(dllimport) - DWORD_ - WINAPI - FormatMessageW( - DWORD_ dwFlags, - LPCVOID_ lpSource, - DWORD_ dwMessageId, - DWORD_ dwLanguageId, - LPWSTR_ lpBuffer, - DWORD_ nSize, - va_list *Arguments - ); - - const int FORMAT_MESSAGE_ALLOCATE_BUFFER_= 0x00000100; - const int FORMAT_MESSAGE_IGNORE_INSERTS_= 0x00000200; - const int FORMAT_MESSAGE_FROM_STRING_= 0x00000400; - const int FORMAT_MESSAGE_FROM_HMODULE_= 0x00000800; - const int FORMAT_MESSAGE_FROM_SYSTEM_= 0x00001000; - const int FORMAT_MESSAGE_ARGUMENT_ARRAY_= 0x00002000; - const int FORMAT_MESSAGE_MAX_WIDTH_MASK_= 0x000000FF; - - const char LANG_NEUTRAL_= 0x00; - const char LANG_INVARIANT_= 0x7f; - - const char SUBLANG_DEFAULT_= 0x01; // user default - inline WORD_ MAKELANGID_(WORD_ p, WORD_ s) { - return ((((WORD_ )(s)) << 10) | (WORD_ )(p)); - } - -} -#endif -} -} -} -#endif // BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP diff --git a/include/boost/detail/winapi/file_management.hpp b/include/boost/detail/winapi/file_management.hpp deleted file mode 100644 index c1d5978..0000000 --- a/include/boost/detail/winapi/file_management.hpp +++ /dev/null @@ -1,130 +0,0 @@ -// thread.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP -#define BOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP - -#include -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost -{ -namespace detail -{ -namespace winapi -{ -#if defined( BOOST_USE_WINDOWS_H ) - using ::CreateFileA; - using ::DeleteFileA; - using ::FindFirstFileA; - using ::FindNextFileA; - using ::FindClose; - using ::GetFileSizeEx; - using ::MoveFileExA; - using ::SetFileValidData; -#else -extern "C" { - typedef struct _OVERLAPPED { - ULONG_PTR Internal; - ULONG_PTR InternalHigh; - union { - struct { - DWORD Offset; - DWORD OffsetHigh; - } ; - PVOID Pointer; - } ; - HANDLE hEvent; - } OVERLAPPED, *LPOVERLAPPED; - - - __declspec(dllimport) void * __stdcall - CreateFileA (const char *, unsigned long, unsigned long, struct SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, void *); - __declspec(dllimport) int __stdcall - DeleteFileA (const char *); - __declspec(dllimport) void *__stdcall - FindFirstFileA(const char *lpFileName, win32_find_data_t *lpFindFileData); - __declspec(dllimport) int __stdcall - FindNextFileA(void *hFindFile, win32_find_data_t *lpFindFileData); - __declspec(dllimport) int __stdcall - FindClose(void *hFindFile); - __declspec(dllimport) BOOL __stdcall - GetFileSizeEx( - HANDLE_ hFile, - PLARGE_INTEGER_ lpFileSize - ); - __declspec(dllimport) int __stdcall - MoveFileExA (const char *, const char *, unsigned long); - __declspec(dllimport) BOOL_ __stdcall - SetFileValidData( - HANDLE_ hFile, - LONGLONG_ ValidDataLength - ); - __declspec(dllimport) BOOL_ __stdcall - SetEndOfFile( - HANDLE_ hFile - ); - __declspec(dllimport) BOOL_ __stdcall - SetFilePointerEx( - HANDLE_ hFile, - LARGE_INTEGER_ liDistanceToMove, - PLARGE_INTEGER_ lpNewFilePointer, - DWORD_ dwMoveMethod - ); - __declspec(dllimport) BOOL_ __stdcall - LockFile( - HANDLE_ hFile, - DWORD_ dwFileOffsetLow, - DWORD_ dwFileOffsetHigh, - DWORD_ nNumberOfBytesToLockLow, - DWORD_ nNumberOfBytesToLockHigh - ); - __declspec(dllimport) BOOL_ __stdcall - UnlockFile( - HANDLE_ hFile, - DWORD_ dwFileOffsetLow, - DWORD_ dwFileOffsetHigh, - DWORD_ nNumberOfBytesToUnlockLow, - DWORD_ nNumberOfBytesToUnlockHigh - ); - __declspec(dllimport) BOOL_ __stdcall - LockFileEx( - HANDLE_ hFile, - DWORD_ dwFlags, - DWORD_ dwReserved, - DWORD_ nNumberOfBytesToLockLow, - DWORD_ nNumberOfBytesToLockHigh, - LPOVERLAPPED_ lpOverlapped - ); - __declspec(dllimport) BOOL_ __stdcall - UnlockFileEx( - HANDLE_ hFile, - DWORD_ dwReserved, - DWORD_ nNumberOfBytesToUnlockLow, - DWORD_ nNumberOfBytesToUnlockHigh, - LPOVERLAPPED_ lpOverlapped - ); - __declspec(dllimport) BOOL_ __stdcall - WriteFile( - HANDLE_ hFile, - LPCVOID_ lpBuffer, - DWORD_ nNumberOfBytesToWrite, - LPDWORD_ lpNumberOfBytesWritten, - LPOVERLAPPED_ lpOverlapped - ); -} -#endif -} -} -} - -#endif // BOOST_DETAIL_WINAPI_THREAD_HPP diff --git a/include/boost/detail/winapi/handles.hpp b/include/boost/detail/winapi/handles.hpp deleted file mode 100644 index 7108daa..0000000 --- a/include/boost/detail/winapi/handles.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// memory.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_HANDLES_HPP -#define BOOST_DETAIL_WINAPI_HANDLES_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost -{ -namespace detail -{ -namespace winapi -{ -#if defined( BOOST_USE_WINDOWS_H ) - using ::CloseHandle; - using ::DuplicateHandle; - - const DWORD_ duplicate_close_source = DUPLICATE_CLOSE_SOURCE; - const DWORD_ duplicate_same_access = DUPLICATE_SAME_ACCESS; - const HANDLE_ invalid_handle_value = INVALID_HANDLE_VALUE; -#else -extern "C" { - __declspec(dllimport) int __stdcall - CloseHandle(void*); - __declspec(dllimport) int __stdcall - DuplicateHandle(void*,void*,void*,void**,unsigned long,int,unsigned long); -} - const DWORD_ duplicate_close_source = 1; - const DWORD_ duplicate_same_access = 2; - const HANDLE_ invalid_handle_value = (HANDLE_)(-1); -#endif -} -} -} - -#endif // BOOST_DETAIL_WINAPI_HANDLES_HPP diff --git a/include/boost/detail/winapi/memory.hpp b/include/boost/detail/winapi/memory.hpp deleted file mode 100644 index b5316e0..0000000 --- a/include/boost/detail/winapi/memory.hpp +++ /dev/null @@ -1,60 +0,0 @@ -// memory.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_MEMORY_HPP -#define BOOST_DETAIL_WINAPI_MEMORY_HPP - -#include -#include -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost -{ -namespace detail -{ -namespace winapi -{ -#if defined( BOOST_USE_WINDOWS_H ) - using ::CreateFileMappingA; - using ::FlushViewOfFile; - using ::GetProcessHeap; - using ::HeapAlloc; - using ::HeapFree; - using ::MapViewOfFileEx; - using ::OpenFileMappingA; - using ::UnmapViewOfFile; -#else -#undef HeapAlloc -extern "C" { - __declspec(dllimport) void * __stdcall - CreateFileMappingA (void *, SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, unsigned long, const char *); - __declspec(dllimport) int __stdcall - FlushViewOfFile (void *, std::size_t); - __declspec(dllimport) HANDLE_ __stdcall - GetProcessHeap(); - __declspec(dllimport) void* __stdcall - HeapAlloc(HANDLE_,DWORD_,SIZE_T_); - __declspec(dllimport) BOOL_ __stdcall - HeapFree(HANDLE_,DWORD_,LPVOID_); - __declspec(dllimport) void * __stdcall - MapViewOfFileEx (void *, unsigned long, unsigned long, unsigned long, std::size_t, void*); - __declspec(dllimport) void * __stdcall - OpenFileMappingA (unsigned long, int, const char *); - __declspec(dllimport) int __stdcall - UnmapViewOfFile(void *); -} -#endif -} -} -} - -#endif // BOOST_DETAIL_WINAPI_MEMORY_HPP diff --git a/include/boost/detail/winapi/process.hpp b/include/boost/detail/winapi/process.hpp deleted file mode 100644 index de287b1..0000000 --- a/include/boost/detail/winapi/process.hpp +++ /dev/null @@ -1,36 +0,0 @@ -// process.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_PROCESS_HPP -#define BOOST_DETAIL_WINAPI_PROCESS_HPP - -#include -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost { -namespace detail { -namespace winapi { -#if defined( BOOST_USE_WINDOWS_H ) - using ::GetCurrentProcessId; -#else -# ifndef UNDER_CE -extern "C" { - __declspec(dllimport) DWORD_ WINAPI GetCurrentProcessId(void); -} -# else - using ::GetCurrentProcessId; -# endif -#endif -} -} -} -#endif // BOOST_DETAIL_WINAPI_PROCESS_HPP diff --git a/include/boost/detail/winapi/security.hpp b/include/boost/detail/winapi/security.hpp deleted file mode 100644 index 79925c6..0000000 --- a/include/boost/detail/winapi/security.hpp +++ /dev/null @@ -1,65 +0,0 @@ -// security.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_SECURITY_HPP -#define BOOST_DETAIL_WINAPI_SECURITY_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost -{ -namespace detail -{ -namespace winapi -{ -#if defined( BOOST_USE_WINDOWS_H ) -typedef ::SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES_; -typedef ::PSECURITY_ATTRIBUTES PSECURITY_ATTRIBUTES_; -typedef ::LPSECURITY_ATTRIBUTES LPSECURITY_ATTRIBUTES_; - -#else -extern "C" { - struct SECURITY_DESCRIPTOR_; - typedef SECURITY_DESCRIPTOR_* PSECURITY_DESCRIPTOR_; - typedef struct _ACL { - BYTE_ AclRevision; - BYTE_ Sbz1; - WORD_ AclSize; - WORD_ AceCount; - WORD_ Sbz2; - } ACL_, *PACL_; - - typedef struct _SECURITY_ATTRIBUTES { - DWORD_ nLength; - LPVOID_ lpSecurityDescriptor; - BOOL_ bInheritHandle; - } SECURITY_ATTRIBUTES_, *PSECURITY_ATTRIBUTES_, *LPSECURITY_ATTRIBUTES_; - - __declspec(dllimport) BOOL_ __stdcall - InitializeSecurityDescriptor( - PSECURITY_DESCRIPTOR_ pSecurityDescriptor, - DWORD_ dwRevision - ); - __declspec(dllimport) BOOL_ __stdcall - SetSecurityDescriptorDacl( - PSECURITY_DESCRIPTOR_ pSecurityDescriptor, - BOOL_ bDaclPresent, - PACL_ pDacl, - BOOL_ bDaclDefaulted - ); -} -#endif -} -} -} - -#endif // BOOST_DETAIL_WINAPI_SECURITY_HPP diff --git a/include/boost/detail/winapi/synchronization.hpp b/include/boost/detail/winapi/synchronization.hpp deleted file mode 100644 index b9497cb..0000000 --- a/include/boost/detail/winapi/synchronization.hpp +++ /dev/null @@ -1,293 +0,0 @@ -// synchronizaion.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP -#define BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost -{ -namespace detail -{ -namespace winapi -{ -#if defined( BOOST_USE_WINDOWS_H ) - typedef ::CRITICAL_SECTION CRITICAL_SECTION_; - typedef ::PAPCFUNC PAPCFUNC_; - -#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 - typedef ::INIT_ONCE INIT_ONCE_; - typedef ::PINIT_ONCE PINIT_ONCE_; - typedef ::LPINIT_ONCE LPINIT_ONCE_; - #define BOOST_DETAIL_WINAPI_INIT_ONCE_STATIC_INIT INIT_ONCE_STATIC_INIT - typedef ::PINIT_ONCE_FN PINIT_ONCE_FN_; - - typedef ::SRWLOCK SRWLOCK_; - typedef ::PSRWLOCK PSRWLOCK_; - #define BOOST_DETAIL_WINAPI_SRWLOCK_INIT SRWLOCK_INIT - - typedef ::CONDITION_VARIABLE CONDITION_VARIABLE_; - typedef ::PCONDITION_VARIABLE PCONDITION_VARIABLE_; - #define BOOST_DETAIL_WINAPI_CONDITION_VARIABLE_INIT CONDITION_VARIABLE_INIT -#endif - - using ::InitializeCriticalSection; -#if BOOST_USE_WINAPI_VERSION >= 0x0403 - using ::InitializeCriticalSectionAndSpinCount; -#endif - using ::EnterCriticalSection; - using ::TryEnterCriticalSection; - using ::LeaveCriticalSection; - using ::DeleteCriticalSection; - -# ifdef BOOST_NO_ANSI_APIS - using ::CreateMutexW; - using ::OpenMutexW; - using ::CreateEventW; - using ::OpenEventW; - using ::CreateSemaphoreW; - using ::OpenSemaphoreW; -# else - using ::CreateMutexA; - using ::OpenMutexA; - using ::CreateEventA; - using ::OpenEventA; - using ::CreateSemaphoreA; - using ::OpenSemaphoreA; -# endif - using ::ReleaseMutex; - using ::ReleaseSemaphore; - using ::SetEvent; - using ::ResetEvent; - using ::WaitForMultipleObjects; - using ::WaitForSingleObject; - using ::QueueUserAPC; - -#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 - using ::InitOnceInitialize; - using ::InitOnceExecuteOnce; - using ::InitOnceBeginInitialize; - using ::InitOnceComplete; - - using ::InitializeSRWLock; - using ::AcquireSRWLockExclusive; - using ::TryAcquireSRWLockExclusive; - using ::ReleaseSRWLockExclusive; - using ::AcquireSRWLockShared; - using ::TryAcquireSRWLockShared; - using ::ReleaseSRWLockShared; - - using ::InitializeConditionVariable; - using ::WakeConditionVariable; - using ::WakeAllConditionVariable; - using ::SleepConditionVariableCS; - using ::SleepConditionVariableSRW; -#endif - - const DWORD_ infinite = INFINITE; - const DWORD_ wait_abandoned = WAIT_ABANDONED; - const DWORD_ wait_object_0 = WAIT_OBJECT_0; - const DWORD_ wait_timeout = WAIT_TIMEOUT; - const DWORD_ wait_failed = WAIT_FAILED; - -#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 - const DWORD_ init_once_async = INIT_ONCE_ASYNC; - const DWORD_ init_once_check_only = INIT_ONCE_CHECK_ONLY; - const DWORD_ init_once_init_failed = INIT_ONCE_INIT_FAILED; - const DWORD_ init_once_ctx_reserved_bits = INIT_ONCE_CTX_RESERVED_BITS; - - const ULONG_ condition_variable_lockmode_shared = CONDITION_VARIABLE_LOCKMODE_SHARED; -#endif - -#else // defined( BOOST_USE_WINDOWS_H ) - -extern "C" { - - typedef struct CRITICAL_SECTION_ - { - struct critical_section_debug * DebugInfo; - long LockCount; - long RecursionCount; - void * OwningThread; - void * LockSemaphore; - #if defined(_WIN64) - unsigned __int64 SpinCount; - #else - unsigned long SpinCount; - #endif - } - *PCRITICAL_SECTION_; - -#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 - typedef union INIT_ONCE_ - { - PVOID_ Ptr; - } - *PINIT_ONCE_, *LPINIT_ONCE_; - #define BOOST_DETAIL_WINAPI_INIT_ONCE_STATIC_INIT {0} - typedef BOOL_ (WINAPI *PINIT_ONCE_FN_)(PINIT_ONCE_ InitOnce, PVOID_ Parameter, PVOID_ *Context); - - typedef struct SRWLOCK_ - { - PVOID_ Ptr; - } - * PSRWLOCK_; - #define BOOST_DETAIL_WINAPI_SRWLOCK_INIT {0} - - typedef struct CONDITION_VARIABLE_ - { - PVOID_ Ptr; - } - * PCONDITION_VARIABLE_; - #define BOOST_DETAIL_WINAPI_CONDITION_VARIABLE_INIT {0} - -#endif - - __declspec(dllimport) void WINAPI - InitializeCriticalSection(PCRITICAL_SECTION_); -#if BOOST_USE_WINAPI_VERSION >= 0x0403 - __declspec(dllimport) BOOL_ WINAPI - InitializeCriticalSectionAndSpinCount(CRITICAL_SECTION_* lpCS, DWORD_ dwSpinCount); -#endif - __declspec(dllimport) void WINAPI - EnterCriticalSection(PCRITICAL_SECTION_); - __declspec(dllimport) BOOL_ WINAPI - TryEnterCriticalSection(PCRITICAL_SECTION_); - __declspec(dllimport) void WINAPI - LeaveCriticalSection(PCRITICAL_SECTION_); - __declspec(dllimport) void WINAPI - DeleteCriticalSection(PCRITICAL_SECTION_); - - struct _SECURITY_ATTRIBUTES; -# ifdef BOOST_NO_ANSI_APIS - __declspec(dllimport) HANDLE_ WINAPI - CreateMutexW(_SECURITY_ATTRIBUTES*, BOOL_, LPCWSTR_); - __declspec(dllimport) HANDLE_ WINAPI - OpenMutexW(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName); - __declspec(dllimport) HANDLE_ WINAPI - CreateSemaphoreW(_SECURITY_ATTRIBUTES*, LONG_, LONG_, LPCWSTR_); - __declspec(dllimport) HANDLE_ WINAPI - OpenSemaphoreW(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName); - __declspec(dllimport) HANDLE_ WINAPI - CreateEventW(_SECURITY_ATTRIBUTES*, BOOL_, BOOL_, LPCWSTR_); - __declspec(dllimport) HANDLE_ WINAPI - OpenEventW(DWORD_, BOOL_, LPCWSTR_); -# else - __declspec(dllimport) HANDLE_ WINAPI - CreateMutexA(_SECURITY_ATTRIBUTES*, BOOL_, LPCSTR_); - __declspec(dllimport) HANDLE_ WINAPI - OpenMutexA(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName); - __declspec(dllimport) HANDLE_ WINAPI - CreateSemaphoreA(_SECURITY_ATTRIBUTES*, LONG_, LONG_, LPCSTR_); - __declspec(dllimport) HANDLE_ WINAPI - OpenSemaphoreA(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName); - __declspec(dllimport) HANDLE_ WINAPI - CreateEventA(_SECURITY_ATTRIBUTES*, BOOL_, BOOL_, LPCSTR_); - __declspec(dllimport) HANDLE_ WINAPI - OpenEventA(DWORD_, BOOL_, LPCSTR_); -# endif - __declspec(dllimport) BOOL_ WINAPI - ReleaseMutex(HANDLE_); - __declspec(dllimport) DWORD_ WINAPI - WaitForSingleObject(HANDLE_, DWORD_); - __declspec(dllimport) DWORD_ WINAPI - WaitForMultipleObjects(DWORD_ nCount, - HANDLE_ const * lpHandles, - BOOL_ bWaitAll, - DWORD_ dwMilliseconds); - __declspec(dllimport) BOOL_ WINAPI - ReleaseSemaphore(HANDLE_, LONG_, LONG_*); - __declspec(dllimport) BOOL_ WINAPI - SetEvent(HANDLE_); - __declspec(dllimport) BOOL_ WINAPI - ResetEvent(HANDLE_); - - typedef void (__stdcall *PAPCFUNC_)(ULONG_PTR_); - __declspec(dllimport) DWORD_ WINAPI - QueueUserAPC(PAPCFUNC_, HANDLE_, ULONG_PTR_); - -#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 - __declspec(dllimport) void WINAPI InitOnceInitialize(PINIT_ONCE_); - __declspec(dllimport) BOOL_ WINAPI InitOnceExecuteOnce(PINIT_ONCE_ InitOnce, PINIT_ONCE_FN_ InitFn, PVOID_ Parameter, LPVOID_* Context); - __declspec(dllimport) BOOL_ WINAPI InitOnceBeginInitialize(LPINIT_ONCE_ lpInitOnce, DWORD_ dwFlags, BOOL_* fPending, LPVOID_* lpContext); - __declspec(dllimport) BOOL_ WINAPI InitOnceComplete(LPINIT_ONCE_ lpInitOnce, DWORD_ dwFlags, LPVOID_* lpContext); - - - __declspec(dllimport) void WINAPI InitializeSRWLock(PSRWLOCK_ SRWLock); - __declspec(dllimport) void WINAPI AcquireSRWLockExclusive(PSRWLOCK_ SRWLock); - __declspec(dllimport) BOOLEAN_ WINAPI TryAcquireSRWLockExclusive(PSRWLOCK_ SRWLock); - __declspec(dllimport) void WINAPI ReleaseSRWLockExclusive(PSRWLOCK_ SRWLock); - __declspec(dllimport) void WINAPI AcquireSRWLockShared(PSRWLOCK_ SRWLock); - __declspec(dllimport) BOOLEAN_ WINAPI TryAcquireSRWLockShared(PSRWLOCK_ SRWLock); - __declspec(dllimport) void WINAPI ReleaseSRWLockShared(PSRWLOCK_ SRWLock); - - __declspec(dllimport) void WINAPI InitializeConditionVariable(PCONDITION_VARIABLE_ ConditionVariable); - __declspec(dllimport) void WINAPI WakeConditionVariable(PCONDITION_VARIABLE_ ConditionVariable); - __declspec(dllimport) void WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE_ ConditionVariable); - __declspec(dllimport) BOOL_ WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE_ ConditionVariable, PCRITICAL_SECTION_ CriticalSection, DWORD_ dwMilliseconds); - __declspec(dllimport) BOOL_ WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE_ ConditionVariable, PSRWLOCK_ SRWLock, DWORD_ dwMilliseconds, ULONG_ Flags); -#endif - -} // extern "C" - -const DWORD_ infinite = (DWORD_)0xFFFFFFFF; -const DWORD_ wait_abandoned = 0x00000080L; -const DWORD_ wait_object_0 = 0x00000000L; -const DWORD_ wait_timeout = 0x00000102L; -const DWORD_ wait_failed = (DWORD_)0xFFFFFFFF; - -#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 -const DWORD_ init_once_async = 0x00000002UL; -const DWORD_ init_once_check_only = 0x00000001UL; -const DWORD_ init_once_init_failed = 0x00000004UL; -const DWORD_ init_once_ctx_reserved_bits = 2; - -const ULONG_ condition_variable_lockmode_shared = 0x00000001; -#endif - -#endif // defined( BOOST_USE_WINDOWS_H ) - -const DWORD_ max_non_infinite_wait = (DWORD_)0xFFFFFFFE; - -BOOST_FORCEINLINE HANDLE_ create_anonymous_mutex(_SECURITY_ATTRIBUTES* lpAttributes, BOOL_ bInitialOwner) -{ -#ifdef BOOST_NO_ANSI_APIS - return CreateMutexW(lpAttributes, bInitialOwner, 0); -#else - return CreateMutexA(lpAttributes, bInitialOwner, 0); -#endif -} - -BOOST_FORCEINLINE HANDLE_ create_anonymous_semaphore(_SECURITY_ATTRIBUTES* lpAttributes, LONG_ lInitialCount, LONG_ lMaximumCount) -{ -#ifdef BOOST_NO_ANSI_APIS - return CreateSemaphoreW(lpAttributes, lInitialCount, lMaximumCount, 0); -#else - return CreateSemaphoreA(lpAttributes, lInitialCount, lMaximumCount, 0); -#endif -} - -BOOST_FORCEINLINE HANDLE_ create_anonymous_event(_SECURITY_ATTRIBUTES* lpAttributes, BOOL_ bManualReset, BOOL_ bInitialState) -{ -#ifdef BOOST_NO_ANSI_APIS - return CreateEventW(lpAttributes, bManualReset, bInitialState, 0); -#else - return CreateEventA(lpAttributes, bManualReset, bInitialState, 0); -#endif -} - -} -} -} - -#endif // BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP diff --git a/include/boost/detail/winapi/system.hpp b/include/boost/detail/winapi/system.hpp deleted file mode 100644 index 2c2d82a..0000000 --- a/include/boost/detail/winapi/system.hpp +++ /dev/null @@ -1,62 +0,0 @@ -// system.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba -// Copyright (c) Microsoft Corporation 2014 - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_SYSTEM_HPP -#define BOOST_DETAIL_WINAPI_SYSTEM_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost { -namespace detail { -namespace winapi { -#if defined( BOOST_USE_WINDOWS_H ) - typedef ::SYSTEM_INFO SYSTEM_INFO_; -# if BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_WINXP -extern "C" __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *); -# else -extern "C" __declspec(dllimport) void __stdcall GetNativeSystemInfo (struct system_info *); -# endif -#else -extern "C" { - typedef struct _SYSTEM_INFO { - union { - DWORD_ dwOemId; - struct { - WORD_ wProcessorArchitecture; - WORD_ wReserved; - } dummy; - } ; - DWORD_ dwPageSize; - LPVOID_ lpMinimumApplicationAddress; - LPVOID_ lpMaximumApplicationAddress; - DWORD_PTR_ dwActiveProcessorMask; - DWORD_ dwNumberOfProcessors; - DWORD_ dwProcessorType; - DWORD_ dwAllocationGranularity; - WORD_ wProcessorLevel; - WORD_ wProcessorRevision; - } SYSTEM_INFO_; - -# if BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_WINXP - __declspec(dllimport) void __stdcall - GetSystemInfo (struct system_info *); -# else - __declspec(dllimport) void __stdcall - GetNativeSystemInfo (struct system_info *); -# endif -} -#endif -} -} -} -#endif // BOOST_DETAIL_WINAPI_SYSTEM_HPP diff --git a/include/boost/detail/winapi/thread.hpp b/include/boost/detail/winapi/thread.hpp deleted file mode 100644 index ee0dac6..0000000 --- a/include/boost/detail/winapi/thread.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// thread.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_THREAD_HPP -#define BOOST_DETAIL_WINAPI_THREAD_HPP - -#include -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost -{ -namespace detail -{ -namespace winapi -{ -#if defined( BOOST_USE_WINDOWS_H ) - using ::GetCurrentThreadId; - using ::SleepEx; - using ::Sleep; - using ::SwitchToThread; -#else -extern "C" { -# ifndef UNDER_CE - __declspec(dllimport) DWORD_ WINAPI GetCurrentThreadId(void); - __declspec(dllimport) DWORD_ WINAPI SleepEx(DWORD_, BOOL_); - __declspec(dllimport) void WINAPI Sleep(DWORD_); - __declspec(dllimport) BOOL_ WINAPI SwitchToThread(void); -#else - using ::GetCurrentThreadId; - using ::SleepEx; - using ::Sleep; - using ::SwitchToThread; -#endif -} -#endif -} -} -} - -#endif // BOOST_DETAIL_WINAPI_THREAD_HPP diff --git a/include/boost/detail/winapi/thread_pool.hpp b/include/boost/detail/winapi/thread_pool.hpp deleted file mode 100644 index 57059dc..0000000 --- a/include/boost/detail/winapi/thread_pool.hpp +++ /dev/null @@ -1,96 +0,0 @@ -// thread_pool.hpp --------------------------------------------------------------// - -// Copyright 2013 Andrey Semashev - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_THREAD_POOL_HPP -#define BOOST_DETAIL_WINAPI_THREAD_POOL_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K - -namespace boost -{ -namespace detail -{ -namespace winapi -{ -#if defined( BOOST_USE_WINDOWS_H ) - -typedef ::WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACKFUNC_; -typedef ::WAITORTIMERCALLBACK WAITORTIMERCALLBACK_; - -using ::RegisterWaitForSingleObject; -using ::UnregisterWait; -using ::UnregisterWaitEx; - -const ULONG_ wt_execute_default = WT_EXECUTEDEFAULT; -const ULONG_ wt_execute_in_io_thread = WT_EXECUTEINIOTHREAD; -const ULONG_ wt_execute_in_ui_thread = WT_EXECUTEINUITHREAD; -const ULONG_ wt_execute_in_wait_thread = WT_EXECUTEINWAITTHREAD; -const ULONG_ wt_execute_only_once = WT_EXECUTEONLYONCE; -const ULONG_ wt_execute_in_timer_thread = WT_EXECUTEINTIMERTHREAD; -const ULONG_ wt_execute_long_function = WT_EXECUTELONGFUNCTION; -const ULONG_ wt_execute_in_persistent_io_thread = WT_EXECUTEINPERSISTENTIOTHREAD; -const ULONG_ wt_execute_in_persistent_thread = WT_EXECUTEINPERSISTENTTHREAD; -const ULONG_ wt_transfer_impersonation = WT_TRANSFER_IMPERSONATION; - -inline ULONG_ wt_set_max_threadpool_threads(ULONG_ flags, ULONG_ limit) -{ - return WT_SET_MAX_THREADPOOL_THREADS(flags, limit); -} - -#else - -extern "C" { - -typedef void (NTAPI* WAITORTIMERCALLBACKFUNC_) (PVOID_, BOOLEAN_); -typedef WAITORTIMERCALLBACKFUNC_ WAITORTIMERCALLBACK_; - -__declspec(dllimport) BOOL_ WINAPI RegisterWaitForSingleObject -( - HANDLE_* phNewWaitObject, - HANDLE_ hObject, - WAITORTIMERCALLBACK_ Callback, - PVOID_ Context, - ULONG_ dwMilliseconds, - ULONG_ dwFlags -); - -__declspec(dllimport) BOOL_ WINAPI UnregisterWait(HANDLE_ WaitHandle); -__declspec(dllimport) BOOL_ WINAPI UnregisterWaitEx(HANDLE_ WaitHandle, HANDLE_ CompletionEvent); - -} // extern "C" - -const ULONG_ wt_execute_default = 0x00000000; -const ULONG_ wt_execute_in_io_thread = 0x00000001; -const ULONG_ wt_execute_in_ui_thread = 0x00000002; -const ULONG_ wt_execute_in_wait_thread = 0x00000004; -const ULONG_ wt_execute_only_once = 0x00000008; -const ULONG_ wt_execute_in_timer_thread = 0x00000020; -const ULONG_ wt_execute_long_function = 0x00000010; -const ULONG_ wt_execute_in_persistent_io_thread = 0x00000040; -const ULONG_ wt_execute_in_persistent_thread = 0x00000080; -const ULONG_ wt_transfer_impersonation = 0x00000100; - -inline ULONG_ wt_set_max_threadpool_threads(ULONG_ flags, ULONG_ limit) -{ - return flags | (limit << 16); -} - -#endif -} -} -} - -#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K - -#endif // BOOST_DETAIL_WINAPI_THREAD_POOL_HPP diff --git a/include/boost/detail/winapi/time.hpp b/include/boost/detail/winapi/time.hpp deleted file mode 100644 index 6a6b447..0000000 --- a/include/boost/detail/winapi/time.hpp +++ /dev/null @@ -1,105 +0,0 @@ -// time.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba -// Copyright (c) Microsoft Corporation 2014 - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_TIME_HPP -#define BOOST_DETAIL_WINAPI_TIME_HPP - -#include -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost { -namespace detail { -namespace winapi { - -#if defined( BOOST_USE_WINDOWS_H ) - - typedef FILETIME FILETIME_; - typedef PFILETIME PFILETIME_; - typedef LPFILETIME LPFILETIME_; - - typedef SYSTEMTIME SYSTEMTIME_; - typedef SYSTEMTIME* PSYSTEMTIME_; - - #ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime - using ::GetSystemTimeAsFileTime; - #endif - #if BOOST_PLAT_WINDOWS_DESKTOP - using ::FileTimeToLocalFileTime; - #endif - using ::GetSystemTime; - using ::SystemTimeToFileTime; - - #if BOOST_PLAT_WINDOWS_DESKTOP - using ::GetTickCount; - #endif - #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 - using ::GetTickCount64; - #endif - -#else - -extern "C" { - typedef struct _FILETIME { - DWORD_ dwLowDateTime; - DWORD_ dwHighDateTime; - } FILETIME_, *PFILETIME_, *LPFILETIME_; - - typedef struct _SYSTEMTIME { - WORD_ wYear; - WORD_ wMonth; - WORD_ wDayOfWeek; - WORD_ wDay; - WORD_ wHour; - WORD_ wMinute; - WORD_ wSecond; - WORD_ wMilliseconds; - } SYSTEMTIME_, *PSYSTEMTIME_; - - #ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime - __declspec(dllimport) void WINAPI - GetSystemTimeAsFileTime(FILETIME_* lpFileTime); - #endif - __declspec(dllimport) int WINAPI - FileTimeToLocalFileTime(const FILETIME_* lpFileTime, - FILETIME_* lpLocalFileTime); - __declspec(dllimport) void WINAPI - GetSystemTime(SYSTEMTIME_* lpSystemTime); - __declspec(dllimport) int WINAPI - SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime, - FILETIME_* lpFileTime); - #if BOOST_PLAT_WINDOWS_DESKTOP - __declspec(dllimport) DWORD_ WINAPI - GetTickCount(); - #endif - #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 - __declspec(dllimport) ULONGLONG_ WINAPI - GetTickCount64(); - #endif -} - -#endif - -#ifndef BOOST_HAS_GETSYSTEMTIMEASFILETIME -inline void WINAPI GetSystemTimeAsFileTime(FILETIME_* lpFileTime) -{ - SYSTEMTIME_ st; - GetSystemTime(&st); - SystemTimeToFileTime(&st, lpFileTime); -} -#endif - -} -} -} - -#endif // BOOST_DETAIL_WINAPI_TIME_HPP diff --git a/include/boost/detail/winapi/timers.hpp b/include/boost/detail/winapi/timers.hpp deleted file mode 100644 index 04c6dfb..0000000 --- a/include/boost/detail/winapi/timers.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// timers.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_TIMERS_HPP -#define BOOST_DETAIL_WINAPI_TIMERS_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost -{ -namespace detail -{ -namespace winapi -{ -#if defined( BOOST_USE_WINDOWS_H ) - using ::QueryPerformanceCounter; - using ::QueryPerformanceFrequency; -#else -extern "C" { - __declspec(dllimport) BOOL_ WINAPI - QueryPerformanceCounter( - LARGE_INTEGER_ *lpPerformanceCount - ); - - __declspec(dllimport) BOOL_ WINAPI - QueryPerformanceFrequency( - LARGE_INTEGER_ *lpFrequency - ); -} -#endif -} -} -} - -#endif // BOOST_DETAIL_WINAPI_TIMERS_HPP diff --git a/include/boost/detail/winapi/tls.hpp b/include/boost/detail/winapi/tls.hpp deleted file mode 100644 index d948693..0000000 --- a/include/boost/detail/winapi/tls.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// tls.hpp --------------------------------------------------------------// - -// Copyright 2013 Andrey Semashev - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_TLS_HPP -#define BOOST_DETAIL_WINAPI_TLS_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost -{ -namespace detail -{ -namespace winapi -{ -#if defined( BOOST_USE_WINDOWS_H ) - -using ::TlsAlloc; -using ::TlsGetValue; -using ::TlsSetValue; -using ::TlsFree; - -const DWORD_ tls_out_of_indexes = TLS_OUT_OF_INDEXES; - -#else - -extern "C" { -__declspec(dllimport) DWORD_ WINAPI TlsAlloc(void); -__declspec(dllimport) LPVOID_ WINAPI TlsGetValue(DWORD_ dwTlsIndex); -__declspec(dllimport) BOOL_ WINAPI TlsSetValue(DWORD_ dwTlsIndex, LPVOID_ lpTlsValue); -__declspec(dllimport) BOOL_ WINAPI TlsFree(DWORD_ dwTlsIndex); -} - -const DWORD_ tls_out_of_indexes = 0xFFFFFFFF; - -#endif -} -} -} - -#endif // BOOST_DETAIL_WINAPI_TLS_HPP diff --git a/include/boost/detail/winapi/waitable_timer.hpp b/include/boost/detail/winapi/waitable_timer.hpp deleted file mode 100644 index 52a7338..0000000 --- a/include/boost/detail/winapi/waitable_timer.hpp +++ /dev/null @@ -1,110 +0,0 @@ -// waitable_timer.hpp --------------------------------------------------------------// - -// Copyright 2013 Andrey Semashev - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP -#define BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -namespace boost -{ -namespace detail -{ -namespace winapi -{ -#if defined( BOOST_USE_WINDOWS_H ) - -typedef ::PTIMERAPCROUTINE PTIMERAPCROUTINE_; - -# ifdef BOOST_NO_ANSI_APIS -using ::CreateWaitableTimerW; -using ::OpenWaitableTimerW; -# else -using ::CreateWaitableTimerA; -using ::OpenWaitableTimerA; -# endif -using ::SetWaitableTimer; -using ::CancelWaitableTimer; - -#else - -extern "C" { - -struct _SECURITY_ATTRIBUTES; - -typedef void (WINAPI* PTIMERAPCROUTINE_) -( - LPVOID_ lpArgToCompletionRoutine, - DWORD_ dwTimerLowValue, - DWORD_ dwTimerHighValue -); - -# ifdef BOOST_NO_ANSI_APIS -__declspec(dllimport) HANDLE_ WINAPI CreateWaitableTimerW -( - _SECURITY_ATTRIBUTES* lpTimerAttributes, - BOOL_ bManualReset, - LPCWSTR_ lpTimerName -); - -__declspec(dllimport) HANDLE_ WINAPI OpenWaitableTimerW -( - DWORD_ dwDesiredAccess, - BOOL_ bInheritHandle, - LPCWSTR_ lpTimerName -); -# else -__declspec(dllimport) HANDLE_ WINAPI CreateWaitableTimerA -( - _SECURITY_ATTRIBUTES* lpTimerAttributes, - BOOL_ bManualReset, - LPCSTR_ lpTimerName -); - -__declspec(dllimport) HANDLE_ WINAPI OpenWaitableTimerA -( - DWORD_ dwDesiredAccess, - BOOL_ bInheritHandle, - LPCSTR_ lpTimerName -); -# endif - -__declspec(dllimport) BOOL_ WINAPI SetWaitableTimer -( - HANDLE_ hTimer, - const LARGE_INTEGER_ *lpDueTime, - LONG_ lPeriod, - PTIMERAPCROUTINE_ pfnCompletionRoutine, - LPVOID_ lpArgToCompletionRoutine, - BOOL_ fResume -); - -__declspec(dllimport) BOOL_ WINAPI CancelWaitableTimer(HANDLE_ hTimer); - -} - -#endif - -BOOST_FORCEINLINE HANDLE_ create_anonymous_waitable_timer(_SECURITY_ATTRIBUTES* lpTimerAttributes, BOOL_ bManualReset) -{ -#ifdef BOOST_NO_ANSI_APIS - return CreateWaitableTimerW(lpTimerAttributes, bManualReset, 0); -#else - return CreateWaitableTimerA(lpTimerAttributes, bManualReset, 0); -#endif -} - -} -} -} - -#endif // BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP From efc21f5bf453650ff39f3c4fa493d53954d94060 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 6 Jun 2014 03:09:40 +0300 Subject: [PATCH 10/10] Remove boost/detail/iterator.hpp, moved to core. --- include/boost/detail/iterator.hpp | 443 ------------------------------ 1 file changed, 443 deletions(-) delete mode 100644 include/boost/detail/iterator.hpp diff --git a/include/boost/detail/iterator.hpp b/include/boost/detail/iterator.hpp deleted file mode 100644 index abaee26..0000000 --- a/include/boost/detail/iterator.hpp +++ /dev/null @@ -1,443 +0,0 @@ -// (C) Copyright David Abrahams 2002. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// Boost versions of -// -// std::iterator_traits<>::iterator_category -// std::iterator_traits<>::difference_type -// std::distance() -// -// ...for all compilers and iterators -// -// Additionally, if X is a pointer -// std::iterator_traits::pointer - -// Otherwise, if partial specialization is supported or X is not a pointer -// std::iterator_traits::value_type -// std::iterator_traits::pointer -// std::iterator_traits::reference -// -// See http://www.boost.org for most recent version including documentation. - -// Revision History -// 04 Mar 2001 - More attempted fixes for Intel C++ (David Abrahams) -// 03 Mar 2001 - Put all implementation into namespace -// boost::detail::iterator_traits_. Some progress made on fixes -// for Intel compiler. (David Abrahams) -// 02 Mar 2001 - Changed BOOST_MSVC to BOOST_MSVC_STD_ITERATOR in a few -// places. (Jeremy Siek) -// 19 Feb 2001 - Improved workarounds for stock MSVC6; use yes_type and -// no_type from type_traits.hpp; stopped trying to remove_cv -// before detecting is_pointer, in honor of the new type_traits -// semantics. (David Abrahams) -// 13 Feb 2001 - Make it work with nearly all standard-conforming iterators -// under raw VC6. The one category remaining which will fail is -// that of iterators derived from std::iterator but not -// boost::iterator and which redefine difference_type. -// 11 Feb 2001 - Clean away code which can never be used (David Abrahams) -// 09 Feb 2001 - Always have a definition for each traits member, even if it -// can't be properly deduced. These will be incomplete types in -// some cases (undefined), but it helps suppress MSVC errors -// elsewhere (David Abrahams) -// 07 Feb 2001 - Support for more of the traits members where possible, making -// this useful as a replacement for std::iterator_traits when -// used as a default template parameter. -// 06 Feb 2001 - Removed useless #includes of standard library headers -// (David Abrahams) - -#ifndef ITERATOR_DWA122600_HPP_ -# define ITERATOR_DWA122600_HPP_ - -# include -# include - -// STLPort 4.0 and betas have a bug when debugging is enabled and there is no -// partial specialization: instead of an iterator_category typedef, the standard -// container iterators have _Iterator_category. -// -// Also, whether debugging is enabled or not, there is a broken specialization -// of std::iterator which has no -// typedefs but iterator_category. -# if defined(__SGI_STL_PORT) - -# if (__SGI_STL_PORT <= 0x410) && !defined(__STL_CLASS_PARTIAL_SPECIALIZATION) && defined(__STL_DEBUG) -# define BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF -# endif - -# define BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION - -# endif // STLPort <= 4.1b4 && no partial specialization - -# if !defined(BOOST_NO_STD_ITERATOR_TRAITS) \ - && !defined(BOOST_MSVC_STD_ITERATOR) - -namespace boost { namespace detail { - -// Define a new template so it can be specialized -template -struct iterator_traits - : std::iterator_traits -{}; -using std::distance; - -}} // namespace boost::detail - -# else - -# if !defined(BOOST_MSVC_STD_ITERATOR) - -// This is the case where everything conforms except BOOST_NO_STD_ITERATOR_TRAITS - -namespace boost { namespace detail { - -// Rogue Wave Standard Library fools itself into thinking partial -// specialization is missing on some platforms (e.g. Sun), so fails to -// supply iterator_traits! -template -struct iterator_traits -{ - typedef typename Iterator::value_type value_type; - typedef typename Iterator::reference reference; - typedef typename Iterator::pointer pointer; - typedef typename Iterator::difference_type difference_type; - typedef typename Iterator::iterator_category iterator_category; -}; - -template -struct iterator_traits -{ - typedef T value_type; - typedef T& reference; - typedef T* pointer; - typedef std::ptrdiff_t difference_type; - typedef std::random_access_iterator_tag iterator_category; -}; - -template -struct iterator_traits -{ - typedef T value_type; - typedef T const& reference; - typedef T const* pointer; - typedef std::ptrdiff_t difference_type; - typedef std::random_access_iterator_tag iterator_category; -}; - -}} // namespace boost::detail - -# else - -# include -# include -# include - -# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION -# include -# endif - -# include -# include -# include - -// should be the last #include -# include "boost/type_traits/detail/bool_trait_def.hpp" - -namespace boost { namespace detail { - -BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type) -BOOST_MPL_HAS_XXX_TRAIT_DEF(reference) -BOOST_MPL_HAS_XXX_TRAIT_DEF(pointer) -BOOST_MPL_HAS_XXX_TRAIT_DEF(difference_type) -BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator_category) - -// is_mutable_iterator -- -// -// A metafunction returning true iff T is a mutable iterator type -// with a nested value_type. Will only work portably with iterators -// whose operator* returns a reference, but that seems to be OK for -// the iterators supplied by Dinkumware. Some input iterators may -// compile-time if they arrive here, and if the compiler is strict -// about not taking the address of an rvalue. - -// This one detects ordinary mutable iterators - the result of -// operator* is convertible to the value_type. -template -type_traits::yes_type is_mutable_iterator_helper(T const*, BOOST_DEDUCED_TYPENAME T::value_type*); - -// Since you can't take the address of an rvalue, the guts of -// is_mutable_iterator_impl will fail if we use &*t directly. This -// makes sure we can still work with non-lvalue iterators. -template T* mutable_iterator_lvalue_helper(T& x); -int mutable_iterator_lvalue_helper(...); - - -// This one detects output iterators such as ostream_iterator which -// return references to themselves. -template -type_traits::yes_type is_mutable_iterator_helper(T const*, T const*); - -type_traits::no_type is_mutable_iterator_helper(...); - -template -struct is_mutable_iterator_impl -{ - static T t; - - BOOST_STATIC_CONSTANT( - bool, value = sizeof( - detail::is_mutable_iterator_helper( - (T*)0 - , mutable_iterator_lvalue_helper(*t) // like &*t - )) - == sizeof(type_traits::yes_type) - ); -}; - -BOOST_TT_AUX_BOOL_TRAIT_DEF1( - is_mutable_iterator,T,::boost::detail::is_mutable_iterator_impl::value) - - -// is_full_iterator_traits -- -// -// A metafunction returning true iff T has all the requisite nested -// types to satisfy the requirements for a fully-conforming -// iterator_traits implementation. -template -struct is_full_iterator_traits_impl -{ - enum { value = - has_value_type::value - & has_reference::value - & has_pointer::value - & has_difference_type::value - & has_iterator_category::value - }; -}; - -BOOST_TT_AUX_BOOL_TRAIT_DEF1( - is_full_iterator_traits,T,::boost::detail::is_full_iterator_traits_impl::value) - - -# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF -BOOST_MPL_HAS_XXX_TRAIT_DEF(_Iterator_category) - -// is_stlport_40_debug_iterator -- -// -// A metafunction returning true iff T has all the requisite nested -// types to satisfy the requirements of an STLPort 4.0 debug iterator -// iterator_traits implementation. -template -struct is_stlport_40_debug_iterator_impl -{ - enum { value = - has_value_type::value - & has_reference::value - & has_pointer::value - & has_difference_type::value - & has__Iterator_category::value - }; -}; - -BOOST_TT_AUX_BOOL_TRAIT_DEF1( - is_stlport_40_debug_iterator,T,::boost::detail::is_stlport_40_debug_iterator_impl::value) - -template -struct stlport_40_debug_iterator_traits -{ - typedef typename T::value_type value_type; - typedef typename T::reference reference; - typedef typename T::pointer pointer; - typedef typename T::difference_type difference_type; - typedef typename T::_Iterator_category iterator_category; -}; -# endif // BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF - -template struct pointer_iterator_traits; - -template -struct pointer_iterator_traits -{ - typedef typename remove_const::type value_type; - typedef T* pointer; - typedef T& reference; - typedef std::random_access_iterator_tag iterator_category; - typedef std::ptrdiff_t difference_type; -}; - -// We'll sort iterator types into one of these classifications, from which we -// can determine the difference_type, pointer, reference, and value_type -template -struct standard_iterator_traits -{ - typedef typename Iterator::difference_type difference_type; - typedef typename Iterator::value_type value_type; - typedef typename Iterator::pointer pointer; - typedef typename Iterator::reference reference; - typedef typename Iterator::iterator_category iterator_category; -}; - -template -struct msvc_stdlib_mutable_traits - : std::iterator_traits -{ - typedef typename std::iterator_traits::distance_type difference_type; - typedef typename std::iterator_traits::value_type* pointer; - typedef typename std::iterator_traits::value_type& reference; -}; - -template -struct msvc_stdlib_const_traits - : std::iterator_traits -{ - typedef typename std::iterator_traits::distance_type difference_type; - typedef const typename std::iterator_traits::value_type* pointer; - typedef const typename std::iterator_traits::value_type& reference; -}; - -# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION -template -struct is_bad_output_iterator - : is_base_and_derived< - std::iterator - , Iterator> -{ -}; - -struct bad_output_iterator_traits -{ - typedef void value_type; - typedef void difference_type; - typedef std::output_iterator_tag iterator_category; - typedef void pointer; - typedef void reference; -}; -# endif - -// If we're looking at an MSVC6 (old Dinkumware) ``standard'' -// iterator, this will generate an appropriate traits class. -template -struct msvc_stdlib_iterator_traits - : mpl::if_< - is_mutable_iterator - , msvc_stdlib_mutable_traits - , msvc_stdlib_const_traits - >::type -{}; - -template -struct non_pointer_iterator_traits - : mpl::if_< - // if the iterator contains all the right nested types... - is_full_iterator_traits - // Use a standard iterator_traits implementation - , standard_iterator_traits -# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF - // Check for STLPort 4.0 broken _Iterator_category type - , mpl::if_< - is_stlport_40_debug_iterator - , stlport_40_debug_iterator_traits -# endif - // Otherwise, assume it's a Dinkum iterator - , msvc_stdlib_iterator_traits -# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF - >::type -# endif - >::type -{ -}; - -template -struct iterator_traits_aux - : mpl::if_< - is_pointer - , pointer_iterator_traits - , non_pointer_iterator_traits - >::type -{ -}; - -template -struct iterator_traits -{ - // Explicit forwarding from base class needed to keep MSVC6 happy - // under some circumstances. - private: -# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION - typedef - typename mpl::if_< - is_bad_output_iterator - , bad_output_iterator_traits - , iterator_traits_aux - >::type base; -# else - typedef iterator_traits_aux base; -# endif - public: - typedef typename base::value_type value_type; - typedef typename base::pointer pointer; - typedef typename base::reference reference; - typedef typename base::difference_type difference_type; - typedef typename base::iterator_category iterator_category; -}; - -// This specialization cuts off ETI (Early Template Instantiation) for MSVC. -template <> struct iterator_traits -{ - typedef int value_type; - typedef int pointer; - typedef int reference; - typedef int difference_type; - typedef int iterator_category; -}; - -}} // namespace boost::detail - -# endif // workarounds - -namespace boost { namespace detail { - -namespace iterator_traits_ -{ - template - struct distance_select - { - static Difference execute(Iterator i1, const Iterator i2, ...) - { - Difference result = 0; - while (i1 != i2) - { - ++i1; - ++result; - } - return result; - } - - static Difference execute(Iterator i1, const Iterator i2, std::random_access_iterator_tag*) - { - return i2 - i1; - } - }; -} // namespace boost::detail::iterator_traits_ - -template -inline typename iterator_traits::difference_type -distance(Iterator first, Iterator last) -{ - typedef typename iterator_traits::difference_type diff_t; - typedef typename ::boost::detail::iterator_traits::iterator_category iterator_category; - - return iterator_traits_::distance_select::execute( - first, last, (iterator_category*)0); -} - -}} - -# endif - - -# undef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF -# undef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION - -#endif // ITERATOR_DWA122600_HPP_