From 2423aff085a8c189748680c360d27ad4d08e7bc7 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 30 Jul 2011 20:24:39 +0000 Subject: [PATCH 01/36] Detail: Turn forward declarations for IBM Visual Age standard library. [SVN r73453] --- include/boost/detail/container_fwd.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp index 037fec7..6716afd 100644 --- a/include/boost/detail/container_fwd.hpp +++ b/include/boost/detail/container_fwd.hpp @@ -47,8 +47,7 @@ // MSL standard lib: # define BOOST_DETAIL_NO_CONTAINER_FWD # elif defined(__IBMCPP__) - // take the default VACPP std lib -# define BOOST_DETAIL_NO_CONTAINER_FWD + // The default VACPP std lib, forward declaration seems to be fine. # elif defined(MSIPL_COMPILE_H) // Modena C++ standard library # define BOOST_DETAIL_NO_CONTAINER_FWD From 7b712685cec8d6d09a591d112d7934380795078f Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 17 Oct 2011 20:36:56 +0000 Subject: [PATCH 02/36] Detail: Don't forward declare containers for gcc in profile mode. Refs #6029. Also a big clear comment about `BOOST_DETAIL_NO_CONTAINER_FWD` and a fixed typo. [SVN r75016] --- include/boost/detail/container_fwd.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp index 6716afd..5e4e047 100644 --- a/include/boost/detail/container_fwd.hpp +++ b/include/boost/detail/container_fwd.hpp @@ -16,6 +16,13 @@ #include #include +//////////////////////////////////////////////////////////////////////////////// +// // +// Define BOOST_DETAIL_NO_CONTAINER_FWD if you don't want this header to // +// forward declare standard containers. // +// // +//////////////////////////////////////////////////////////////////////////////// + #if !defined(BOOST_DETAIL_NO_CONTAINER_FWD) # if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) // STLport @@ -31,13 +38,15 @@ # define BOOST_DETAIL_NO_CONTAINER_FWD # elif defined(__GLIBCPP__) || defined(__GLIBCXX__) // GNU libstdc++ 3 -# if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL) +# if defined(_GLIBCXX_DEBUG) \ + || defined(_GLIBCXX_PARALLEL) \ + || defined(_GLIBCXX_PROFILE) # define BOOST_DETAIL_NO_CONTAINER_FWD # endif # elif defined(__STL_CONFIG_H) // generic SGI STL // - // Forward declaration seems to be okay, but it has a copule of odd + // Forward declaration seems to be okay, but it has a couple of odd // implementations. # define BOOST_CONTAINER_FWD_BAD_BITSET # if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG) From 0f51c7701df87feaa4a396f375de0a24842e649d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 7 Nov 2011 23:08:53 +0000 Subject: [PATCH 03/36] Use for VS2010+. Refs #4678. [SVN r75396] --- include/boost/detail/interlocked.hpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index 5889ccb..1802e34 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -54,7 +54,11 @@ extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); #elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN ) -#if defined( __CLRCALL_PURE_OR_CDECL ) +#if defined( BOOST_MSVC ) && BOOST_MSVC >= 1600 + +#include + +#elif defined( __CLRCALL_PURE_OR_CDECL ) extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedIncrement( long volatile * ); extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedDecrement( long volatile * ); @@ -119,15 +123,15 @@ namespace boost namespace detail { -extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedIncrement( long volatile * ); -extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedDecrement( long volatile * ); -extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedCompareExchange( long volatile *, long, long ); -extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchange( long volatile *, long ); -extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchangeAdd( long volatile *, long ); +extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedIncrement( long volatile * ); +extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedDecrement( long volatile * ); +extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedCompareExchange( long volatile *, long, long ); +extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchange( long volatile *, long ); +extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchangeAdd( long volatile *, long ); # if defined(_M_IA64) || defined(_M_AMD64) -extern "C"BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* ); -extern "C"BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedExchangePointer( void* volatile *, void* ); +extern "C" BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* ); +extern "C" BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedExchangePointer( void* volatile *, void* ); # endif } // namespace detail From 4c711ba972226611f99cb0b1edb791ac0d6643fc Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 18 Nov 2011 11:32:43 +0000 Subject: [PATCH 04/36] Detail: Revert [67484] in container_fwd. Refs #6139 [SVN r75544] --- include/boost/detail/container_fwd.hpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp index 5e4e047..7211134 100644 --- a/include/boost/detail/container_fwd.hpp +++ b/include/boost/detail/container_fwd.hpp @@ -117,11 +117,7 @@ namespace std template struct char_traits; #endif - #if BOOST_CLANG - template struct complex; - #else - template class complex; - #endif + template class complex; #if !defined(BOOST_CONTAINER_FWD_BAD_DEQUE) template class deque; From 735804d63678f44535c90192411b8a74b1d44747 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 19 Nov 2011 23:29:24 +0000 Subject: [PATCH 05/36] Detail: `complex` is a struct in Dinkumware. IIRC it's `class` in SGI's STL and most other implementations. The state for similar warnings for the compilers that I've looked at: - Visual C++ never warns because I used a pragma to disable the warning. - GCC never warns with its standard library since it contains a `system_header` pragma. It might warn for other libraries. - Clang respects GCC's pragma so it never warns for GCC's standard library. Forward declarations are disabled for libc++ so this isn't an issue there. It does warn when using Dinkumware and possibly other standard libraries. I'm tempted to make container forwarding 'opt-in' rather than 'opt-out'. Or maybe only enable for compiler/library combinations where it's known to work. [SVN r75561] --- include/boost/detail/container_fwd.hpp | 7 +++++-- test/container_fwd/Jamfile | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp index 7211134..01820ae 100644 --- a/include/boost/detail/container_fwd.hpp +++ b/include/boost/detail/container_fwd.hpp @@ -63,8 +63,7 @@ # elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) // Dinkumware Library (this has to appear after any possible replacement // libraries) - // - // Works fine. +# define BOOST_CONTAINER_FWD_COMPLEX_STRUCT # else # define BOOST_DETAIL_NO_CONTAINER_FWD # endif @@ -117,7 +116,11 @@ namespace std template struct char_traits; #endif +#if defined(BOOST_CONTAINER_FWD_COMPLEX_STRUCT) + template struct complex; +#else template class complex; +#endif #if !defined(BOOST_CONTAINER_FWD_BAD_DEQUE) template class deque; diff --git a/test/container_fwd/Jamfile b/test/container_fwd/Jamfile index b39d447..ab55bc2 100644 --- a/test/container_fwd/Jamfile +++ b/test/container_fwd/Jamfile @@ -11,6 +11,7 @@ project detail/test/container_fwd intel:on gcc:"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion" darwin:"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion" + clang:"-pedantic -Wextra -Wmismatched-tags" on ; From 609cf3c49f8df3647238b38de1f2cef8beebcfe7 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 21 Nov 2011 23:21:32 +0000 Subject: [PATCH 06/36] Detail: Fix `BOOST_CONTAINER_FWD_COMPLEX_STRUCT`. Refs #6139. My last change was wrong, it isn't struct for Dinkumware. In GCC's standard library it's declared as a class, but later defined as a struct. This is so far untested as I'm building the latest trunk version of clang (the warning doesn't show for the current clang release). [SVN r75600] --- include/boost/detail/container_fwd.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp index 01820ae..659e428 100644 --- a/include/boost/detail/container_fwd.hpp +++ b/include/boost/detail/container_fwd.hpp @@ -42,6 +42,10 @@ || defined(_GLIBCXX_PARALLEL) \ || defined(_GLIBCXX_PROFILE) # define BOOST_DETAIL_NO_CONTAINER_FWD +# else +# if defined(__GLIBCXX__) && __GLIBCXX__ >= 20040530 +# define BOOST_CONTAINER_FWD_COMPLEX_STRUCT +# endif # endif # elif defined(__STL_CONFIG_H) // generic SGI STL @@ -63,7 +67,6 @@ # elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) // Dinkumware Library (this has to appear after any possible replacement // libraries) -# define BOOST_CONTAINER_FWD_COMPLEX_STRUCT # else # define BOOST_DETAIL_NO_CONTAINER_FWD # endif From 948271c0aea1b193bbba0c94bbe47898080f03d9 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 5 Jan 2012 17:29:22 +0000 Subject: [PATCH 07/36] Fix Clang workaround. Fixes #6156. [SVN r76323] --- include/boost/detail/fenv.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/fenv.hpp b/include/boost/detail/fenv.hpp index 1ba8833..f048706 100644 --- a/include/boost/detail/fenv.hpp +++ b/include/boost/detail/fenv.hpp @@ -16,9 +16,10 @@ /* If we're using clang + glibc, we have to get hacky. * See http://llvm.org/bugs/show_bug.cgi?id=6907 */ -#if defined(__clang__) && \ +#if defined(__clang__) && (__clang_major__ < 3) && \ defined(__GNU_LIBRARY__) && /* up to version 5 */ \ - defined(__GLIBC__) /* version 6 + */ + defined(__GLIBC__) && /* version 6 + */ \ + !defined(_FENV_H) #define _FENV_H #include From 17612676b83ef42cdffcda9192253e25b5f79397 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 11 Jan 2012 23:00:55 +0000 Subject: [PATCH 08/36] Detail: Disable container forward declarations for recent versions of libstdc++, refs #6326. [SVN r76419] --- include/boost/detail/container_fwd.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp index 659e428..7df7ccb 100644 --- a/include/boost/detail/container_fwd.hpp +++ b/include/boost/detail/container_fwd.hpp @@ -38,7 +38,11 @@ # define BOOST_DETAIL_NO_CONTAINER_FWD # elif defined(__GLIBCPP__) || defined(__GLIBCXX__) // GNU libstdc++ 3 -# if defined(_GLIBCXX_DEBUG) \ + // + // Disable forwarding for all recent versions, as the library has a + // versioned namespace mode, and I don't know how to detect it. +# if __GLIBCXX__ >= 20070513 \ + || defined(_GLIBCXX_DEBUG) \ || defined(_GLIBCXX_PARALLEL) \ || defined(_GLIBCXX_PROFILE) # define BOOST_DETAIL_NO_CONTAINER_FWD From e0e8ccb712325ff5811c0e3cbe5e2b0d44b46551 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 18 Feb 2012 15:48:59 +0000 Subject: [PATCH 09/36] Detail: Add macro to explicitly enable forward declaration of containers. [SVN r77067] --- include/boost/detail/container_fwd.hpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp index 7df7ccb..ef17498 100644 --- a/include/boost/detail/container_fwd.hpp +++ b/include/boost/detail/container_fwd.hpp @@ -21,10 +21,17 @@ // Define BOOST_DETAIL_NO_CONTAINER_FWD if you don't want this header to // // forward declare standard containers. // // // +// BOOST_DETAIL_CONTAINER_FWD to make it foward declare containers even if it // +// normally doesn't. // +// // +// BOOST_DETAIL_NO_CONTAINER_FWD overrides BOOST_DETAIL_CONTAINER_FWD. // +// // //////////////////////////////////////////////////////////////////////////////// #if !defined(BOOST_DETAIL_NO_CONTAINER_FWD) -# if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) +# if defined(BOOST_DETAIL_CONTAINER_FWD) + // Force forward declarations. +# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) // STLport # define BOOST_DETAIL_NO_CONTAINER_FWD # elif defined(__LIBCOMO__) @@ -76,11 +83,6 @@ # endif #endif -// BOOST_DETAIL_TEST_* macros are for testing only -// and shouldn't be relied upon. But you can use -// BOOST_DETAIL_NO_CONTAINER_FWD to prevent forward -// declaration of containers. - #if !defined(BOOST_DETAIL_TEST_CONFIG_ONLY) #if defined(BOOST_DETAIL_NO_CONTAINER_FWD) && \ @@ -118,6 +120,7 @@ namespace std template class basic_string; #if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) + template struct string_char_traits; #else template struct char_traits; From 2a116b4ea4563c3651d3dd186503cb8ef249af9f Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 19 Apr 2012 18:19:20 +0000 Subject: [PATCH 10/36] Summary: Moved libs/detail/utf8_codecvt_facet.cpp to boost/detail/utf8_codecvt_facet.ipp Author: Dave Abrahams [SVN r78081] --- .../boost/detail/utf8_codecvt_facet.ipp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename utf8_codecvt_facet.cpp => include/boost/detail/utf8_codecvt_facet.ipp (99%) diff --git a/utf8_codecvt_facet.cpp b/include/boost/detail/utf8_codecvt_facet.ipp similarity index 99% rename from utf8_codecvt_facet.cpp rename to include/boost/detail/utf8_codecvt_facet.ipp index 7ea5eeb..064fdaf 100644 --- a/utf8_codecvt_facet.cpp +++ b/include/boost/detail/utf8_codecvt_facet.ipp @@ -1,5 +1,5 @@ /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// utf8_codecvt_facet.cpp +// utf8_codecvt_facet.ipp // Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) // Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). From 20332e24e592860638a623413da53bd180ae4400 Mon Sep 17 00:00:00 2001 From: Anthony Williams Date: Thu, 10 May 2012 17:06:15 +0000 Subject: [PATCH 11/36] Combine scoped enum emulation from thread library into detail/scoped_enum_emulation.hpp [SVN r78407] --- .../boost/detail/scoped_enum_emulation.hpp | 110 +++++++++++++++++- 1 file changed, 104 insertions(+), 6 deletions(-) diff --git a/include/boost/detail/scoped_enum_emulation.hpp b/include/boost/detail/scoped_enum_emulation.hpp index e695a20..0defa97 100644 --- a/include/boost/detail/scoped_enum_emulation.hpp +++ b/include/boost/detail/scoped_enum_emulation.hpp @@ -1,6 +1,8 @@ // scoped_enum_emulation.hpp ---------------------------------------------------------// // Copyright Beman Dawes, 2009 +// Copyright (C) 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 @@ -38,19 +40,115 @@ #define BOOST_SCOPED_ENUM_EMULATION_HPP #include +#include + +namespace boost +{ + +#ifdef BOOST_NO_SCOPED_ENUMS + template + struct underlying_type + { + typedef typename EnumType::underlying_type type; + }; + + template + UnderlyingType underlying_cast(EnumType v) + { + return v.underlying(); + } + + template + inline + typename EC::enum_type native_value(EC e) + { + return e.native(); + } + +#else // BOOST_NO_SCOPED_ENUMS + + template + struct underlying_type + { + //typedef typename std::underlying_type::type type; + }; + + template + UnderlyingType underlying_cast(EnumType v) + { + return static_cast(v); + } + + template + inline + EC native_value(EC e) + { + return e; + } + +#endif +} + #ifdef BOOST_NO_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 +#ifndef BOOST_NO_EXPLICIT_CONVERSION_OPERATORS + +#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \ + explicit operator underlying_type() const { return underlying(); } #else -# define BOOST_SCOPED_ENUM_START(name) enum class name -# define BOOST_SCOPED_ENUM_END -# define BOOST_SCOPED_ENUM(name) name +#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR #endif +#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType, UnderlyingType) \ + struct EnumType { \ + typedef UnderlyingType underlying_type; \ + EnumType() {} \ + explicit EnumType(underlying_type v) : v_(v) {} \ + underlying_type underlying() 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 native() const { return enum_type(v_); } \ + friend bool operator ==(self_type lhs, enum_type rhs) { return enum_type(lhs.v_)==rhs; } \ + friend bool operator ==(enum_type lhs, self_type rhs) { return lhs==enum_type(rhs.v_); } \ + friend bool operator !=(self_type lhs, enum_type rhs) { return enum_type(lhs.v_)!=rhs; } \ + friend bool operator !=(enum_type lhs, self_type rhs) { return lhs!=enum_type(rhs.v_); } \ + }; + +#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) \ + ; \ + EnumType(enum_type v) : v_(v) {} \ + BOOST_SCOPED_ENUM_DECLARE_END2() + +#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) \ + BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,int) + +#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType::enum_type +#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) struct EnumType + +#else // BOOST_NO_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_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) + #endif // BOOST_SCOPED_ENUM_EMULATION_HPP From 9378f3d4f700a13131e064db446d40cc26fd600e Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Sat, 12 May 2012 11:07:58 +0000 Subject: [PATCH 12/36] ScopedEnum: Rollback last change as there are regressions on Spirit [SVN r78434] --- .../boost/detail/scoped_enum_emulation.hpp | 271 +++++++++++++++--- 1 file changed, 227 insertions(+), 44 deletions(-) diff --git a/include/boost/detail/scoped_enum_emulation.hpp b/include/boost/detail/scoped_enum_emulation.hpp index 0defa97..0f262f8 100644 --- a/include/boost/detail/scoped_enum_emulation.hpp +++ b/include/boost/detail/scoped_enum_emulation.hpp @@ -1,40 +1,125 @@ // scoped_enum_emulation.hpp ---------------------------------------------------------// // Copyright Beman Dawes, 2009 -// Copyright (C) 2012 Vicente J. Botet Escriba +// 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 -// 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_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. -// -// 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 emulation is via struct rather than namespace to allow use within classes. -// Thanks to Andrey Semashev for pointing that out. -// -// Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott, -// Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, Matt Calabrese, Vincente -// Botet, and Daniel James. -// -// 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 ); +/* +[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_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 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_SCOPED_ENUMS + template <> + struct BOOST_SYMBOL_VISIBLE is_error_code_enum : public true_type { }; + #endif + +use + + #ifdef BOOST_NO_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 @@ -46,18 +131,61 @@ namespace boost { #ifdef BOOST_NO_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 to 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.underlying(); } + /** + * 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. + * + * EC the scoped enum type + * + * @param v A scoped enum. + * @returns The native enum value. + * @throws No-throws. + */ template inline typename EC::enum_type native_value(EC e) @@ -73,6 +201,12 @@ namespace boost //typedef typename std::underlying_type::type type; }; + template + struct native_type + { + typedef EnumType type; + }; + template UnderlyingType underlying_cast(EnumType v) { @@ -103,43 +237,79 @@ namespace boost #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() {} \ + typedef UnderlyingType underlying_type; \ + EnumType() BOOST_NOEXCEPT {} \ explicit EnumType(underlying_type v) : v_(v) {} \ underlying_type underlying() const { return v_; } \ BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \ - private: \ - underlying_type v_; \ + private: \ + underlying_type v_; \ typedef EnumType self_type; \ - public: \ + public: \ enum enum_type #define BOOST_SCOPED_ENUM_DECLARE_END2() \ - enum_type native() const { return enum_type(v_); } \ - friend bool operator ==(self_type lhs, enum_type rhs) { return enum_type(lhs.v_)==rhs; } \ - friend bool operator ==(enum_type lhs, self_type rhs) { return lhs==enum_type(rhs.v_); } \ - friend bool operator !=(self_type lhs, enum_type rhs) { return enum_type(lhs.v_)!=rhs; } \ - friend bool operator !=(enum_type lhs, self_type rhs) { return lhs!=enum_type(rhs.v_); } \ + enum_type native() const BOOST_NOEXCEPT { return enum_type(v_); } \ + operator enum_type() const BOOST_NOEXCEPT { return native(); } \ + 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) : v_(v) {} \ + 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_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_END2() #define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) ; #define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType @@ -147,8 +317,21 @@ namespace boost #endif // BOOST_NO_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) +//#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_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 0e2bc0d9f4ee685275970909b8dfbe3eb7b9840c Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Sat, 12 May 2012 17:29:08 +0000 Subject: [PATCH 13/36] ScopedEnum: Fix issue with native function class [SVN r78437] --- .../boost/detail/scoped_enum_emulation.hpp | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/include/boost/detail/scoped_enum_emulation.hpp b/include/boost/detail/scoped_enum_emulation.hpp index 0f262f8..80394cf 100644 --- a/include/boost/detail/scoped_enum_emulation.hpp +++ b/include/boost/detail/scoped_enum_emulation.hpp @@ -28,7 +28,7 @@ Some of the enumerations defined in the standard library are scoped enums. no_state }; -On compilers that don't support them, the library two emulations: +On compilers that don't support them, the library provides two emulations: [heading Strict] @@ -164,7 +164,7 @@ namespace boost /** * Casts a scoped enum to its underlying type. * - * This function is useful to when working with scoped enum classes which doens't implicitly convert to the 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. @@ -172,7 +172,7 @@ namespace boost template UnderlyingType underlying_cast(EnumType v) { - return v.underlying(); + return v.get_underlying_value_(); } /** @@ -180,17 +180,17 @@ namespace boost * * This function is useful to make programs portable when the scoped enum emulation can not be use where native enums can. * - * EC the scoped enum type + * EnumType the scoped enum type * * @param v A scoped enum. * @returns The native enum value. * @throws No-throws. */ - template + template inline - typename EC::enum_type native_value(EC e) + typename EnumType::enum_type native_value(EnumType e) { - return e.native(); + return e.native_value_(); } #else // BOOST_NO_SCOPED_ENUMS @@ -213,9 +213,9 @@ namespace boost return static_cast(v); } - template + template inline - EC native_value(EC e) + EnumType native_value(EnumType e) { return e; } @@ -229,7 +229,7 @@ namespace boost #ifndef BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \ - explicit operator underlying_type() const { return underlying(); } + explicit operator underlying_type() const { return get_underlying_value_(); } #else @@ -248,7 +248,7 @@ namespace boost typedef UnderlyingType underlying_type; \ EnumType() BOOST_NOEXCEPT {} \ explicit EnumType(underlying_type v) : v_(v) {} \ - underlying_type underlying() const { return v_; } \ + underlying_type get_underlying_value_() const { return v_; } \ BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \ private: \ underlying_type v_; \ @@ -257,8 +257,8 @@ namespace boost enum enum_type #define BOOST_SCOPED_ENUM_DECLARE_END2() \ - enum_type native() const BOOST_NOEXCEPT { return enum_type(v_); } \ - operator enum_type() const BOOST_NOEXCEPT { return native(); } \ + 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_); } \ @@ -317,21 +317,21 @@ namespace boost #endif // BOOST_NO_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) +#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_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 +//#ifdef BOOST_NO_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 b39e23464ba3df1827e55972f5fae89f27629162 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 21 May 2012 21:58:18 +0000 Subject: [PATCH 14/36] Add warning to deprecated header `boost/functional/detail/container_fwd.hpp`. Should have done this years ago, removing this header should make modularization a tad bit cleaner. [SVN r78533] --- test/container_fwd/container_fwd_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/container_fwd/container_fwd_test.cpp b/test/container_fwd/container_fwd_test.cpp index 55c2e04..f12c7c3 100644 --- a/test/container_fwd/container_fwd_test.cpp +++ b/test/container_fwd/container_fwd_test.cpp @@ -3,7 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include +#include #if BOOST_WORKAROUND(__GNUC__, < 3) && \ !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) From 804546aacf39a550178cb3b59886150ea16944f8 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Sat, 7 Jul 2012 10:27:13 +0000 Subject: [PATCH 15/36] Chrono: Try to fix issue with WinError.h file [SVN r79328] --- include/boost/detail/win/basic_types.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/win/basic_types.hpp b/include/boost/detail/win/basic_types.hpp index f4e3472..79f6787 100644 --- a/include/boost/detail/win/basic_types.hpp +++ b/include/boost/detail/win/basic_types.hpp @@ -14,7 +14,7 @@ #if defined( BOOST_USE_WINDOWS_H ) # include #elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__) -# include +# include // @FIXME Which condition must be tested # ifdef UNDER_CE # ifndef WINAPI From 0c7444b84f59bf39d64c15caebb00d62a11603f8 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Wed, 15 Aug 2012 10:02:09 +0000 Subject: [PATCH 16/36] Thread: Try to fix 5431 [SVN r80042] --- include/boost/detail/interlocked.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index 1802e34..4c87e6e 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -35,11 +35,11 @@ // under Windows CE we still have old-style Interlocked* functions -extern "C" long __cdecl InterlockedIncrement( long* ); -extern "C" long __cdecl InterlockedDecrement( long* ); -extern "C" long __cdecl InterlockedCompareExchange( long*, long, long ); -extern "C" long __cdecl InterlockedExchange( long*, long ); -extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); +extern "C" long __cdecl InterlockedIncrement( long volatile * ); +extern "C" long __cdecl InterlockedDecrement( long volatile * ); +extern "C" long __cdecl InterlockedCompareExchange( long volatile *, long, long ); +extern "C" long __cdecl InterlockedExchange( long volatile *, long ); +extern "C" long __cdecl InterlockedExchangeAdd( long volatile *, long ); # define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement # define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement From d8159674fa521a383fab96f3620f93f61285843a Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Fri, 17 Aug 2012 15:27:56 +0000 Subject: [PATCH 17/36] Thread: Rollback last modification as it breaks regression test VeecoFTC/msvc-9.0~wm5~stlport5.2 [SVN r80067] --- include/boost/detail/interlocked.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index 4c87e6e..1802e34 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -35,11 +35,11 @@ // under Windows CE we still have old-style Interlocked* functions -extern "C" long __cdecl InterlockedIncrement( long volatile * ); -extern "C" long __cdecl InterlockedDecrement( long volatile * ); -extern "C" long __cdecl InterlockedCompareExchange( long volatile *, long, long ); -extern "C" long __cdecl InterlockedExchange( long volatile *, long ); -extern "C" long __cdecl InterlockedExchangeAdd( long volatile *, long ); +extern "C" long __cdecl InterlockedIncrement( long* ); +extern "C" long __cdecl InterlockedDecrement( long* ); +extern "C" long __cdecl InterlockedCompareExchange( long*, long, long ); +extern "C" long __cdecl InterlockedExchange( long*, long ); +extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); # define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement # define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement From 5973a2bcef2d8033a80a89f8062c702af4ef71aa Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Tue, 21 Aug 2012 21:36:12 +0000 Subject: [PATCH 18/36] Thread: Try again to fix 5431 [SVN r80127] --- include/boost/detail/interlocked.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index 1802e34..916db81 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -33,6 +33,15 @@ #elif defined(_WIN32_WCE) +#if _WIN32_WCE >= 0x600 + +extern "C" long __cdecl _InterlockedIncrement( long volatile * ); +extern "C" long __cdecl _InterlockedDecrement( long volatile * ); +extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long ); +extern "C" long __cdecl _InterlockedExchange( long volatile *, long ); +extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long ); + +#else // under Windows CE we still have old-style Interlocked* functions extern "C" long __cdecl InterlockedIncrement( long* ); @@ -41,6 +50,8 @@ extern "C" long __cdecl InterlockedCompareExchange( long*, long, long ); extern "C" long __cdecl InterlockedExchange( long*, long ); extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); +#endif + # define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement # define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement # define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange From 67f78550e5936c9d40833f830adef585360c5b2e Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 1 Sep 2012 14:47:29 +0000 Subject: [PATCH 19/36] Detail: Merge some whitespace fixes from release. [SVN r80349] --- include/boost/detail/win/GetCurrentThread.hpp | 2 +- include/boost/detail/win/GetProcessTimes.hpp | 2 +- include/boost/detail/win/time.hpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/boost/detail/win/GetCurrentThread.hpp b/include/boost/detail/win/GetCurrentThread.hpp index 4e12d60..cdc6d36 100644 --- a/include/boost/detail/win/GetCurrentThread.hpp +++ b/include/boost/detail/win/GetCurrentThread.hpp @@ -18,7 +18,7 @@ namespace win32 { // Windows CE define GetCurrentThread as an inline function in kfuncs.h inline HANDLE_ GetCurrentThread() { - return ::GetCurrentThread(); + return ::GetCurrentThread(); } #else #if defined( BOOST_USE_WINDOWS_H ) diff --git a/include/boost/detail/win/GetProcessTimes.hpp b/include/boost/detail/win/GetProcessTimes.hpp index d8ccb35..8d76995 100644 --- a/include/boost/detail/win/GetProcessTimes.hpp +++ b/include/boost/detail/win/GetProcessTimes.hpp @@ -14,7 +14,7 @@ namespace boost { namespace detail { namespace win32 { -#if !defined(UNDER_CE) // Windows CE does not define GetProcessTimes +#if !defined(UNDER_CE) // Windows CE does not define GetProcessTimes #if defined( BOOST_USE_WINDOWS_H ) using ::GetProcessTimes; #else diff --git a/include/boost/detail/win/time.hpp b/include/boost/detail/win/time.hpp index e1c912b..7f636ed 100644 --- a/include/boost/detail/win/time.hpp +++ b/include/boost/detail/win/time.hpp @@ -23,9 +23,9 @@ namespace win32 { typedef SYSTEMTIME SYSTEMTIME_; typedef SYSTEMTIME* PSYSTEMTIME_; - #ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime + #ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime using ::GetSystemTimeAsFileTime; - #endif + #endif using ::FileTimeToLocalFileTime; using ::GetSystemTime; using ::SystemTimeToFileTime; @@ -49,10 +49,10 @@ extern "C" { WORD_ wMilliseconds; } SYSTEMTIME_, *PSYSTEMTIME_; - #ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime + #ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime __declspec(dllimport) void WINAPI GetSystemTimeAsFileTime(FILETIME_* lpFileTime); - #endif + #endif __declspec(dllimport) int WINAPI FileTimeToLocalFileTime(const FILETIME_* lpFileTime, FILETIME_* lpLocalFileTime); From 2cbdcde36884e27b145a294d9debcc6dbd440950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Sat, 22 Sep 2012 15:35:41 +0000 Subject: [PATCH 20/36] Fix: intrin.h is available in msvc-9.0 (_MSC_VER 1500) [SVN r80626] --- include/boost/detail/interlocked.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index 916db81..6434cb8 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -65,7 +65,7 @@ extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); #elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN ) -#if defined( BOOST_MSVC ) && BOOST_MSVC >= 1600 +#if defined( BOOST_MSVC ) && BOOST_MSVC >= 1500 #include From 112b2471b703eb765d59ffef35309429ffa7eb36 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 10 Oct 2012 13:11:38 +0000 Subject: [PATCH 21/36] Fix the _WIN32_WCE >= 0x600 case. [SVN r80935] --- include/boost/detail/interlocked.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index 6434cb8..c8870d9 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -41,6 +41,12 @@ extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long extern "C" long __cdecl _InterlockedExchange( long volatile *, long ); extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long ); +# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement +# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange +# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange +# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd + #else // under Windows CE we still have old-style Interlocked* functions @@ -50,14 +56,14 @@ extern "C" long __cdecl InterlockedCompareExchange( long*, long, long ); extern "C" long __cdecl InterlockedExchange( long*, long ); extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); -#endif - # define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement # define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement # define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange # define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd +#endif + # define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long*)(dest),(long)(exchange),(long)(compare))) # define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ From 2ea55870e4865a8ac173fee08f73d85232a28acc Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 22 Oct 2012 17:47:41 +0000 Subject: [PATCH 22/36] Fix up for Arm. Fixes #7516. [SVN r81047] --- include/boost/detail/endian.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 98c870c..6894882 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -57,7 +57,7 @@ || defined(_POWER) || defined(__powerpc__) \ || defined(__ppc__) || defined(__hpux) || defined(__hppa) \ || defined(_MIPSEB) || defined(_POWER) \ - || defined(__s390__) + || defined(__s390__) || defined(__ARMEB__) # define BOOST_BIG_ENDIAN # define BOOST_BYTE_ORDER 4321 #elif defined(__i386__) || defined(__alpha__) \ @@ -66,7 +66,9 @@ || defined(_M_ALPHA) || defined(__amd64) \ || defined(__amd64__) || defined(_M_AMD64) \ || defined(__x86_64) || defined(__x86_64__) \ - || defined(_M_X64) || defined(__bfin__) + || defined(_M_X64) || defined(__bfin__) \ + || defined(__ARMEL__) \ + || (defined(_WIN32) && defined(__ARM__) && defined(_MSC_VER)) // ARM Windows CE don't define anything reasonably unique, but there are no big-endian Windows versions # define BOOST_LITTLE_ENDIAN # define BOOST_BYTE_ORDER 1234 @@ -76,3 +78,4 @@ #endif + From c77e8e89cf8d5285d6ad27ac08a8aa4878a8b4f9 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 22 Oct 2012 18:12:51 +0000 Subject: [PATCH 23/36] Fix stray whitespace in previous commit. Refs #7516. [SVN r81048] --- include/boost/detail/endian.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 6894882..d9ab3a7 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -67,7 +67,7 @@ || defined(__amd64__) || defined(_M_AMD64) \ || defined(__x86_64) || defined(__x86_64__) \ || defined(_M_X64) || defined(__bfin__) \ - || defined(__ARMEL__) \ + || defined(__ARMEL__) \ || (defined(_WIN32) && defined(__ARM__) && defined(_MSC_VER)) // ARM Windows CE don't define anything reasonably unique, but there are no big-endian Windows versions # define BOOST_LITTLE_ENDIAN From dc1a439ec059d805a24dcc4e61239b52b8da2b45 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Tue, 20 Nov 2012 19:44:24 +0000 Subject: [PATCH 24/36] Remove usage of deprecated macros [SVN r81442] --- .../boost/detail/scoped_enum_emulation.hpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/boost/detail/scoped_enum_emulation.hpp b/include/boost/detail/scoped_enum_emulation.hpp index 80394cf..d266e0e 100644 --- a/include/boost/detail/scoped_enum_emulation.hpp +++ b/include/boost/detail/scoped_enum_emulation.hpp @@ -11,7 +11,7 @@ [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_SCOPED_ENUMS +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 @@ -71,14 +71,14 @@ use And instead of - #ifdef BOOST_NO_SCOPED_ENUMS + #ifdef BOOST_NO_CXX11_SCOPED_ENUMS template <> struct BOOST_SYMBOL_VISIBLE is_error_code_enum : public true_type { }; #endif use - #ifdef BOOST_NO_SCOPED_ENUMS + #ifdef BOOST_NO_CXX11_SCOPED_ENUMS template <> struct BOOST_SYMBOL_VISIBLE is_error_code_enum : public true_type { }; #endif @@ -130,7 +130,7 @@ Sample usage: namespace boost { -#ifdef BOOST_NO_SCOPED_ENUMS +#ifdef BOOST_NO_CXX11_SCOPED_ENUMS /** * Meta-function to get the underlying type of a scoped enum. * @@ -193,7 +193,7 @@ namespace boost return e.native_value_(); } -#else // BOOST_NO_SCOPED_ENUMS +#else // BOOST_NO_CXX11_SCOPED_ENUMS template struct underlying_type @@ -224,9 +224,9 @@ namespace boost } -#ifdef BOOST_NO_SCOPED_ENUMS +#ifdef BOOST_NO_CXX11_SCOPED_ENUMS -#ifndef BOOST_NO_EXPLICIT_CONVERSION_OPERATORS +#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS #define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \ explicit operator underlying_type() const { return get_underlying_value_(); } @@ -305,7 +305,7 @@ namespace boost */ #define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) struct EnumType -#else // BOOST_NO_SCOPED_ENUMS +#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 @@ -315,13 +315,13 @@ namespace boost #define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType #define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) enum class EnumType -#endif // BOOST_NO_SCOPED_ENUMS +#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_SCOPED_ENUMS +//#ifdef BOOST_NO_CXX11_SCOPED_ENUMS // //# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_type //# define BOOST_SCOPED_ENUM_END }; From d5aa8a952a6aa6def641842b4be3e2641e196e72 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Wed, 28 Nov 2012 19:12:42 +0000 Subject: [PATCH 25/36] Fixed incorrect 'const' param for utf8_codecvt_facet::do_length [SVN r81616] --- include/boost/detail/utf8_codecvt_facet.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index 65c5e4e..c57cd02 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -92,8 +92,7 @@ namespace std { } #endif -#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) \ - && !defined(_LIBCPP_VERSION) +#if defined(_MSC_VER) && (_MSC_VER < 1700) #define BOOST_CODECVT_DO_LENGTH_CONST const #else #define BOOST_CODECVT_DO_LENGTH_CONST From eb6208f69ac85ceaa0bd13e050476d519d8e89fd Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Wed, 12 Dec 2012 15:41:26 +0000 Subject: [PATCH 26/36] Made codecvt::do_length param constant based on the library used, not the compiler [SVN r81877] --- include/boost/detail/utf8_codecvt_facet.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index c57cd02..553cc99 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -92,7 +92,7 @@ namespace std { } #endif -#if defined(_MSC_VER) && (_MSC_VER < 1700) +#if defined(_CPPLIB_VER) && (_CPPLIB_VER < 540) #define BOOST_CODECVT_DO_LENGTH_CONST const #else #define BOOST_CODECVT_DO_LENGTH_CONST From ae93c52b7536a76e83a09b5e8df2d39c0d787194 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 19 Feb 2013 11:59:27 +0000 Subject: [PATCH 27/36] Apply BSD patch. Refs #6013. [SVN r82996] --- include/boost/detail/endian.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index d9ab3a7..447efe0 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -43,6 +43,23 @@ # error Unknown machine endianness detected. # endif # define BOOST_BYTE_ORDER __BYTE_ORDER +#elif defined(__NetBSD__) || defined(__FreeBSD__) || \ + defined(__OpenBSD__) || (__DragonFly__) +# if defined(__OpenBSD__) +# include +# else +# include +# endif +# if (_BYTE_ORDER == _LITTLE_ENDIAN) +# define BOOST_LITTLE_ENDIAN +# elif (_BYTE_ORDER == _BIG_ENDIAN) +# define BOOST_BIG_ENDIAN +# elif (_BYTE_ORDER == _PDP_ENDIAN) +# define BOOST_PDP_ENDIAN +# else +# error Unknown machine endianness detected. +# endif +# define BOOST_BYTE_ORDER _BYTE_ORDER #elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) || \ defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) || \ defined(_STLP_BIG_ENDIAN) && !defined(_STLP_LITTLE_ENDIAN) From 538f8f7b3bca0cf9054da9d8f2a380cd8e9e45cb Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 19 Feb 2013 16:06:55 +0000 Subject: [PATCH 28/36] Apply patch for XBox and Android. Refs #7528. [SVN r83004] --- include/boost/detail/endian.hpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 447efe0..40277fb 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -28,10 +28,12 @@ #ifndef BOOST_DETAIL_ENDIAN_HPP #define BOOST_DETAIL_ENDIAN_HPP +// +// Special cases come first: +// +#if defined (__GLIBC__) // GNU libc offers the helpful header which defines // __BYTE_ORDER - -#if defined (__GLIBC__) # include # if (__BYTE_ORDER == __LITTLE_ENDIAN) # define BOOST_LITTLE_ENDIAN @@ -43,8 +45,11 @@ # error Unknown machine endianness detected. # endif # define BOOST_BYTE_ORDER __BYTE_ORDER + #elif defined(__NetBSD__) || defined(__FreeBSD__) || \ defined(__OpenBSD__) || (__DragonFly__) +// +// BSD has endian.h, see https://svn.boost.org/trac/boost/ticket/6013 # if defined(__OpenBSD__) # include # else @@ -60,6 +65,27 @@ # error Unknown machine endianness detected. # endif # define BOOST_BYTE_ORDER _BYTE_ORDER + +#elif defined( __ANDROID__ ) +// Adroid specific code, see: https://svn.boost.org/trac/boost/ticket/7528 +// Here we can use machine/_types.h, see: +// http://stackoverflow.com/questions/6212951/endianness-of-android-ndk +# include "machine/_types.h" +# ifdef __ARMEB__ +# define BOOST_BIG_ENDIAN +# define BOOST_BYTE_ORDER 4321 +# else +# define BOOST_LITTLE_ENDIAN +# define BOOST_BYTE_ORDER 1234 +# endif // __ARMEB__ + +#elif defined( _XBOX ) +// +// XBox is always big endian?? +// +# define BOOST_BIG_ENDIAN +# define BOOST_BYTE_ORDER 4321 + #elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) || \ defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) || \ defined(_STLP_BIG_ENDIAN) && !defined(_STLP_LITTLE_ENDIAN) From 19ca421f241968c3eb2910741f0650f761b03eb1 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 19 Feb 2013 16:09:27 +0000 Subject: [PATCH 29/36] Apply patch from 7703. Refs #7703. [SVN r83005] --- include/boost/detail/endian.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 40277fb..3236808 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -88,11 +88,13 @@ #elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) || \ defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) || \ + defined(__BIGENDIAN__) && !defined(__LITTLEENDIAN__) || \ defined(_STLP_BIG_ENDIAN) && !defined(_STLP_LITTLE_ENDIAN) # define BOOST_BIG_ENDIAN # define BOOST_BYTE_ORDER 4321 #elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) || \ defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) || \ + defined(__LITTLEENDIAN__) && !defined(__BIGENDIAN__) || \ defined(_STLP_LITTLE_ENDIAN) && !defined(_STLP_BIG_ENDIAN) # define BOOST_LITTLE_ENDIAN # define BOOST_BYTE_ORDER 1234 From bd58c2d229bea091639a3a8c35cc46b39f225021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Thu, 14 Mar 2013 23:08:40 +0000 Subject: [PATCH 30/36] Added BOOST_TEST_THROWS [SVN r83433] --- include/boost/detail/lightweight_test.hpp | 65 +++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/include/boost/detail/lightweight_test.hpp b/include/boost/detail/lightweight_test.hpp index dbd99b9..49dd5e4 100644 --- a/include/boost/detail/lightweight_test.hpp +++ b/include/boost/detail/lightweight_test.hpp @@ -12,21 +12,61 @@ // // Copyright (c) 2002, 2009 Peter Dimov // Copyright (2) Beman Dawes 2010, 2011 +// Copyright (3) Ion Gaztanaga 2013 // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // +// --------------- +// +// If expression is false increases the error count +// and outputs a message containing 'expression' +// // BOOST_TEST(expression) +// +// --------------- +// +// Increases error count and outputs a message containing 'message' +// // BOOST_ERROR(message) +// +// --------------- +// +// If 'expr1' != 'expr2' increases the error count +// and outputs a message containing both expressions +// // BOOST_TEST_EQ(expr1, expr2) // +// --------------- +// +// If 'expr1' == 'expr2' increases the error count +// and outputs a message containing both expressions +// +// BOOST_TEST_NE(expr1, expr2) +// +// --------------- +// +// If BOOST_NO_EXCEPTIONS is NOT defined and if 'expr' does not +// throw an exception of type 'excep', increases the error count +// and outputs a message containing the expression. +// +// If BOOST_NO_EXCEPTIONS is defined, this macro expands to nothing +// and 'expr' is not evaluated. +// +// BOOST_TEST_THROWS(expr, excep) +// +// --------------- +// +// Returns the error count +// // int boost::report_errors() // #include #include #include +#include // IDE's like Visual Studio perform better if output goes to std::cout or // some other stream, so allow user to configure output stream: @@ -79,6 +119,14 @@ inline void error_impl(char const * msg, char const * file, int line, char const ++test_errors(); } +inline void throw_failed_impl(char const * excep, char const * file, int line, char const * function) +{ + BOOST_LIGHTWEIGHT_TEST_OSTREAM + << file << "(" << line << "): Exception '" << excep << "' not thrown in function '" + << function << "'" << std::endl; + ++test_errors(); +} + template inline void test_eq_impl( char const * expr1, char const * expr2, char const * file, int line, char const * function, T const & t, U const & u ) { @@ -139,5 +187,22 @@ inline int report_errors() #define BOOST_ERROR(msg) ::boost::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) #define BOOST_TEST_EQ(expr1,expr2) ( ::boost::detail::test_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) ) #define BOOST_TEST_NE(expr1,expr2) ( ::boost::detail::test_ne_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) ) +#ifndef BOOST_NO_EXCEPTIONS + #define BOOST_TEST_THROWS( EXPR, EXCEP ) \ + try { \ + EXPR; \ + ::boost::detail::throw_failed_impl \ + (#EXCEP, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \ + } \ + catch(EXCEP const&) { \ + } \ + catch(...) { \ + ::boost::detail::throw_failed_impl \ + (#EXCEP, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \ + } \ + // +#else + #define BOOST_TEST_THROWS( EXPR, EXCEP ) +#endif #endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED From 81cbc142ac47bc21336cab4ff3e6dff6ccbfb7c2 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 13 Jun 2013 15:50:50 +0000 Subject: [PATCH 31/36] Fix typo. Refs #7664. [SVN r84758] --- include/boost/detail/is_function_ref_tester.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100755 => 100644 include/boost/detail/is_function_ref_tester.hpp diff --git a/include/boost/detail/is_function_ref_tester.hpp b/include/boost/detail/is_function_ref_tester.hpp old mode 100755 new mode 100644 index 5f367ea..8e7d1d7 --- a/include/boost/detail/is_function_ref_tester.hpp +++ b/include/boost/detail/is_function_ref_tester.hpp @@ -112,7 +112,7 @@ boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T #else #define BOOST_PP_ITERATION_PARAMS_1 \ - (3, (0, 25, "boost/type_traits/detail/is_function_ref_tester.hpp")) + (3, (0, 25, "boost/detail/is_function_ref_tester.hpp")) #include BOOST_PP_ITERATE() #endif // BOOST_TT_PREPROCESSING_MODE @@ -133,3 +133,4 @@ boost::type_traits::yes_type is_function_ref_tester(R (&)(BOOST_PP_ENUM_PARAMS(i #undef i #endif // BOOST_PP_IS_ITERATING + From 6a98633c6c0ea2c81efd2d9ea2ef6f5685c3d4cc Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 7 Aug 2013 03:03:23 +0000 Subject: [PATCH 32/36] Rewrite content to use Predef endian detection. This removes the non-BSL license use. [SVN r85230] --- include/boost/detail/endian.hpp | 121 +------------------------------- 1 file changed, 3 insertions(+), 118 deletions(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 3236808..3e37db9 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -1,126 +1,11 @@ -// Copyright 2005 Caleb Epstein -// Copyright 2006 John Maddock -// Copyright 2010 Rene Rivera +// 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) -/* - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/* - * Copyright notice reproduced from , from - * which this code was originally taken. - * - * Modified by Caleb Epstein to use with GNU libc and to - * defined the BOOST_ENDIAN macro. - */ - #ifndef BOOST_DETAIL_ENDIAN_HPP #define BOOST_DETAIL_ENDIAN_HPP -// -// Special cases come first: -// -#if defined (__GLIBC__) -// GNU libc offers the helpful header which defines -// __BYTE_ORDER -# include -# if (__BYTE_ORDER == __LITTLE_ENDIAN) -# define BOOST_LITTLE_ENDIAN -# elif (__BYTE_ORDER == __BIG_ENDIAN) -# define BOOST_BIG_ENDIAN -# elif (__BYTE_ORDER == __PDP_ENDIAN) -# define BOOST_PDP_ENDIAN -# else -# error Unknown machine endianness detected. -# endif -# define BOOST_BYTE_ORDER __BYTE_ORDER - -#elif defined(__NetBSD__) || defined(__FreeBSD__) || \ - defined(__OpenBSD__) || (__DragonFly__) -// -// BSD has endian.h, see https://svn.boost.org/trac/boost/ticket/6013 -# if defined(__OpenBSD__) -# include -# else -# include -# endif -# if (_BYTE_ORDER == _LITTLE_ENDIAN) -# define BOOST_LITTLE_ENDIAN -# elif (_BYTE_ORDER == _BIG_ENDIAN) -# define BOOST_BIG_ENDIAN -# elif (_BYTE_ORDER == _PDP_ENDIAN) -# define BOOST_PDP_ENDIAN -# else -# error Unknown machine endianness detected. -# endif -# define BOOST_BYTE_ORDER _BYTE_ORDER - -#elif defined( __ANDROID__ ) -// Adroid specific code, see: https://svn.boost.org/trac/boost/ticket/7528 -// Here we can use machine/_types.h, see: -// http://stackoverflow.com/questions/6212951/endianness-of-android-ndk -# include "machine/_types.h" -# ifdef __ARMEB__ -# define BOOST_BIG_ENDIAN -# define BOOST_BYTE_ORDER 4321 -# else -# define BOOST_LITTLE_ENDIAN -# define BOOST_BYTE_ORDER 1234 -# endif // __ARMEB__ - -#elif defined( _XBOX ) -// -// XBox is always big endian?? -// -# define BOOST_BIG_ENDIAN -# define BOOST_BYTE_ORDER 4321 - -#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) || \ - defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) || \ - defined(__BIGENDIAN__) && !defined(__LITTLEENDIAN__) || \ - defined(_STLP_BIG_ENDIAN) && !defined(_STLP_LITTLE_ENDIAN) -# define BOOST_BIG_ENDIAN -# define BOOST_BYTE_ORDER 4321 -#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) || \ - defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) || \ - defined(__LITTLEENDIAN__) && !defined(__BIGENDIAN__) || \ - defined(_STLP_LITTLE_ENDIAN) && !defined(_STLP_BIG_ENDIAN) -# define BOOST_LITTLE_ENDIAN -# define BOOST_BYTE_ORDER 1234 -#elif defined(__sparc) || defined(__sparc__) \ - || defined(_POWER) || defined(__powerpc__) \ - || defined(__ppc__) || defined(__hpux) || defined(__hppa) \ - || defined(_MIPSEB) || defined(_POWER) \ - || defined(__s390__) || defined(__ARMEB__) -# define BOOST_BIG_ENDIAN -# define BOOST_BYTE_ORDER 4321 -#elif defined(__i386__) || defined(__alpha__) \ - || defined(__ia64) || defined(__ia64__) \ - || defined(_M_IX86) || defined(_M_IA64) \ - || defined(_M_ALPHA) || defined(__amd64) \ - || defined(__amd64__) || defined(_M_AMD64) \ - || defined(__x86_64) || defined(__x86_64__) \ - || defined(_M_X64) || defined(__bfin__) \ - || defined(__ARMEL__) \ - || (defined(_WIN32) && defined(__ARM__) && defined(_MSC_VER)) // ARM Windows CE don't define anything reasonably unique, but there are no big-endian Windows versions - -# define BOOST_LITTLE_ENDIAN -# define BOOST_BYTE_ORDER 1234 -#else -# error The file boost/detail/endian.hpp needs to be set up for your CPU type. -#endif - +// Use the Predef library for the detection of endianess. +#include #endif - From 79bce0a5f2303a875949e8a1dae63041c70fd968 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sun, 15 Sep 2013 10:46:54 +0000 Subject: [PATCH 33/36] sync: add semaphore implementation [SVN r85673] --- include/boost/detail/win/synchronization.hpp | 58 ++++++++++++-------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/include/boost/detail/win/synchronization.hpp b/include/boost/detail/win/synchronization.hpp index 8fe015b..d899b41 100644 --- a/include/boost/detail/win/synchronization.hpp +++ b/include/boost/detail/win/synchronization.hpp @@ -27,7 +27,7 @@ namespace win32 using ::TryEnterCriticalSection; using ::LeaveCriticalSection; using ::DeleteCriticalSection; - + # ifdef BOOST_NO_ANSI_APIS using ::CreateMutexW; using ::CreateEventW; @@ -46,6 +46,12 @@ namespace win32 using ::WaitForMultipleObjects; using ::WaitForSingleObject; using ::QueueUserAPC; + + static const DWORD_ wait_abandoned = WAIT_ABANDONED; + static const DWORD_ wait_object_0 = WAIT_OBJECT_0; + static const DWORD_ wait_timeout = WAIT_TIMEOUT; + static const DWORD_ wait_failed = WAIT_FAILED; + #else extern "C" { struct CRITICAL_SECTION_ @@ -62,61 +68,67 @@ extern "C" { #endif }; - __declspec(dllimport) void __stdcall + __declspec(dllimport) void __stdcall InitializeCriticalSection(CRITICAL_SECTION_ *); - __declspec(dllimport) void __stdcall + __declspec(dllimport) void __stdcall EnterCriticalSection(CRITICAL_SECTION_ *); - __declspec(dllimport) bool __stdcall + __declspec(dllimport) bool __stdcall TryEnterCriticalSection(CRITICAL_SECTION_ *); - __declspec(dllimport) void __stdcall + __declspec(dllimport) void __stdcall LeaveCriticalSection(CRITICAL_SECTION_ *); - __declspec(dllimport) void __stdcall + __declspec(dllimport) void __stdcall DeleteCriticalSection(CRITICAL_SECTION_ *); - + struct _SECURITY_ATTRIBUTES; # ifdef BOOST_NO_ANSI_APIS - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall CreateMutexW(_SECURITY_ATTRIBUTES*,int,wchar_t const*); - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall CreateSemaphoreW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*); - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall CreateEventW(_SECURITY_ATTRIBUTES*,int,int,wchar_t const*); - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall OpenEventW(unsigned long,int,wchar_t const*); # else - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall CreateMutexA(_SECURITY_ATTRIBUTES*,int,char const*); - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall CreateSemaphoreA(_SECURITY_ATTRIBUTES*,long,long,char const*); - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall CreateEventA(_SECURITY_ATTRIBUTES*,int,int,char const*); - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall OpenEventA(unsigned long,int,char const*); # endif - __declspec(dllimport) int __stdcall + __declspec(dllimport) int __stdcall ReleaseMutex(void*); - __declspec(dllimport) unsigned long __stdcall + __declspec(dllimport) unsigned long __stdcall WaitForSingleObject(void*,unsigned long); - __declspec(dllimport) unsigned long __stdcall + __declspec(dllimport) unsigned long __stdcall WaitForMultipleObjects(unsigned long nCount, void* const * lpHandles, int bWaitAll, unsigned long dwMilliseconds); - __declspec(dllimport) int __stdcall + __declspec(dllimport) int __stdcall ReleaseSemaphore(void*,long,long*); typedef void (__stdcall *PAPCFUNC8)(ulong_ptr); - __declspec(dllimport) unsigned long __stdcall + __declspec(dllimport) unsigned long __stdcall QueueUserAPC(PAPCFUNC8,void*,ulong_ptr); # ifndef UNDER_CE - __declspec(dllimport) int __stdcall + __declspec(dllimport) int __stdcall SetEvent(void*); - __declspec(dllimport) int __stdcall + __declspec(dllimport) int __stdcall ResetEvent(void*); # else using ::SetEvent; using ::ResetEvent; + + static const DWORD_ wait_abandoned = 0x00000080L; + static const DWORD_ wait_object_0 = 0x00000000L; + static const DWORD_ wait_timeout = 0x00000102L; + static const DWORD_ wait_failed = (DWORD_)0xFFFFFFFF; + # endif -} +} #endif } } From e1e8b05e02cc3a43e5378aee32d50ce877bde58b Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sun, 15 Sep 2013 16:58:33 +0000 Subject: [PATCH 34/36] Moved semaphore implementation to details. Some minor fixes. [SVN r85679] --- include/boost/detail/win/synchronization.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/boost/detail/win/synchronization.hpp b/include/boost/detail/win/synchronization.hpp index d899b41..5a6ab0b 100644 --- a/include/boost/detail/win/synchronization.hpp +++ b/include/boost/detail/win/synchronization.hpp @@ -45,8 +45,9 @@ namespace win32 using ::ResetEvent; using ::WaitForMultipleObjects; using ::WaitForSingleObject; - using ::QueueUserAPC; + using ::QueueUserAPC; + static const DWORD_ infinite = INFINITE; static const DWORD_ wait_abandoned = WAIT_ABANDONED; static const DWORD_ wait_object_0 = WAIT_OBJECT_0; static const DWORD_ wait_timeout = WAIT_TIMEOUT; @@ -122,6 +123,7 @@ extern "C" { using ::SetEvent; using ::ResetEvent; + static const DWORD_ infinite = (DWORD_)0xFFFFFFFF; static const DWORD_ wait_abandoned = 0x00000080L; static const DWORD_ wait_object_0 = 0x00000000L; static const DWORD_ wait_timeout = 0x00000102L; From 8590e40965564d06bf17f1cb4e536a810b50961c Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 18 Sep 2013 21:25:36 +0000 Subject: [PATCH 35/36] Added GetSystemTimeAsFileTime definition when it is absent in WinAPI. Made constants as enum so that they can be used in switch/case statements. Added Boost.Sync time_units and mutex for Windows. [SVN r85779] --- include/boost/detail/win/synchronization.hpp | 26 ++++++++++++-------- include/boost/detail/win/time.hpp | 20 +++++++++++---- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/include/boost/detail/win/synchronization.hpp b/include/boost/detail/win/synchronization.hpp index 5a6ab0b..391e0ef 100644 --- a/include/boost/detail/win/synchronization.hpp +++ b/include/boost/detail/win/synchronization.hpp @@ -47,11 +47,14 @@ namespace win32 using ::WaitForSingleObject; using ::QueueUserAPC; - static const DWORD_ infinite = INFINITE; - static const DWORD_ wait_abandoned = WAIT_ABANDONED; - static const DWORD_ wait_object_0 = WAIT_OBJECT_0; - static const DWORD_ wait_timeout = WAIT_TIMEOUT; - static const DWORD_ wait_failed = WAIT_FAILED; + enum + { + infinite = INFINITE, + wait_abandoned = WAIT_ABANDONED, + wait_object_0 = WAIT_OBJECT_0, + wait_timeout = WAIT_TIMEOUT, + wait_failed = WAIT_FAILED + }; #else extern "C" { @@ -123,11 +126,14 @@ extern "C" { using ::SetEvent; using ::ResetEvent; - static const DWORD_ infinite = (DWORD_)0xFFFFFFFF; - static const DWORD_ wait_abandoned = 0x00000080L; - static const DWORD_ wait_object_0 = 0x00000000L; - static const DWORD_ wait_timeout = 0x00000102L; - static const DWORD_ wait_failed = (DWORD_)0xFFFFFFFF; + enum + { + infinite = (DWORD_)0xFFFFFFFF, + wait_abandoned = 0x00000080L, + wait_object_0 = 0x00000000L, + wait_timeout = 0x00000102L, + wait_failed = (DWORD_)0xFFFFFFFF + }; # endif } diff --git a/include/boost/detail/win/time.hpp b/include/boost/detail/win/time.hpp index 7f636ed..b0adfa7 100644 --- a/include/boost/detail/win/time.hpp +++ b/include/boost/detail/win/time.hpp @@ -23,7 +23,7 @@ namespace win32 { typedef SYSTEMTIME SYSTEMTIME_; typedef SYSTEMTIME* PSYSTEMTIME_; - #ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime + #ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime using ::GetSystemTimeAsFileTime; #endif using ::FileTimeToLocalFileTime; @@ -49,22 +49,32 @@ extern "C" { WORD_ wMilliseconds; } SYSTEMTIME_, *PSYSTEMTIME_; - #ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime + #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, + FileTimeToLocalFileTime(const FILETIME_* lpFileTime, FILETIME_* lpLocalFileTime); __declspec(dllimport) void WINAPI GetSystemTime(SYSTEMTIME_* lpSystemTime); __declspec(dllimport) int WINAPI - SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime, + SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime, FILETIME_* lpFileTime); - __declspec(dllimport) unsigned long __stdcall + __declspec(dllimport) DWORD_ WINAPI GetTickCount(); } #endif + +#ifndef BOOST_HAS_GETSYSTEMTIMEASFILETIME +inline void WINAPI GetSystemTimeAsFileTime(FILETIME_* lpFileTime) +{ + SYSTEMTIME_ st; + GetSystemTime(&st); + SystemTimeToFileTime(&st, lpFileTime); +} +#endif + } } } From ce5864b47eb949c749676b917e843d0b67e3a6a0 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 19 Sep 2013 17:58:24 +0000 Subject: [PATCH 36/36] To avoid name clashes with Boost.Thread, renamed boost::detail::win32 namespace to winapi. Also renamed the directory with headers accordingly. Adjusted Boost.Chrono and Boost.Sync to reflect the changes. [SVN r85791] --- .../{win => winapi}/GetCurrentProcess.hpp | 14 +++-- .../{win => winapi}/GetCurrentThread.hpp | 14 +++-- .../detail/{win => winapi}/GetLastError.hpp | 14 +++-- .../{win => winapi}/GetProcessTimes.hpp | 14 +++-- .../detail/{win => winapi}/GetThreadTimes.hpp | 14 +++-- .../detail/{win => winapi}/LocalFree.hpp | 14 +++-- .../detail/{win => winapi}/basic_types.hpp | 15 +++-- .../{win => winapi}/directory_management.hpp | 17 +++--- include/boost/detail/{win => winapi}/dll.hpp | 17 +++--- .../detail/{win => winapi}/error_handling.hpp | 17 ++++-- .../{win => winapi}/file_management.hpp | 16 ++++-- .../boost/detail/{win => winapi}/handles.hpp | 13 +++-- .../boost/detail/{win => winapi}/memory.hpp | 21 +++---- .../boost/detail/{win => winapi}/process.hpp | 16 ++++-- .../boost/detail/{win => winapi}/security.hpp | 13 +++-- .../{win => winapi}/synchronization.hpp | 57 ++++++++++--------- .../boost/detail/{win => winapi}/system.hpp | 18 +++--- .../boost/detail/{win => winapi}/thread.hpp | 16 ++++-- include/boost/detail/{win => winapi}/time.hpp | 13 +++-- .../boost/detail/{win => winapi}/timers.hpp | 13 +++-- 20 files changed, 207 insertions(+), 139 deletions(-) rename include/boost/detail/{win => winapi}/GetCurrentProcess.hpp (62%) rename include/boost/detail/{win => winapi}/GetCurrentThread.hpp (70%) rename include/boost/detail/{win => winapi}/GetLastError.hpp (63%) rename include/boost/detail/{win => winapi}/GetProcessTimes.hpp (73%) rename include/boost/detail/{win => winapi}/GetThreadTimes.hpp (71%) rename include/boost/detail/{win => winapi}/LocalFree.hpp (67%) rename include/boost/detail/{win => winapi}/basic_types.hpp (92%) rename include/boost/detail/{win => winapi}/directory_management.hpp (74%) rename include/boost/detail/{win => winapi}/dll.hpp (77%) rename include/boost/detail/{win => winapi}/error_handling.hpp (89%) rename include/boost/detail/{win => winapi}/file_management.hpp (92%) rename include/boost/detail/{win => winapi}/handles.hpp (71%) rename include/boost/detail/{win => winapi}/memory.hpp (80%) rename include/boost/detail/{win => winapi}/process.hpp (64%) rename include/boost/detail/{win => winapi}/security.hpp (85%) rename include/boost/detail/{win => winapi}/synchronization.hpp (78%) rename include/boost/detail/{win => winapi}/system.hpp (75%) rename include/boost/detail/{win => winapi}/thread.hpp (73%) rename include/boost/detail/{win => winapi}/time.hpp (89%) rename include/boost/detail/{win => winapi}/timers.hpp (74%) diff --git a/include/boost/detail/win/GetCurrentProcess.hpp b/include/boost/detail/winapi/GetCurrentProcess.hpp similarity index 62% rename from include/boost/detail/win/GetCurrentProcess.hpp rename to include/boost/detail/winapi/GetCurrentProcess.hpp index a76eb06..51206bb 100644 --- a/include/boost/detail/win/GetCurrentProcess.hpp +++ b/include/boost/detail/winapi/GetCurrentProcess.hpp @@ -6,14 +6,18 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_GETCURRENTPROCESS_HPP -#define BOOST_DETAIL_WIN_GETCURRENTPROCESS_HPP +#ifndef BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP +#define BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP -#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 { +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) using ::GetCurrentProcess; #else @@ -22,4 +26,4 @@ namespace win32 { } } } -#endif // BOOST_DETAIL_WIN_TIME_HPP +#endif // BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP diff --git a/include/boost/detail/win/GetCurrentThread.hpp b/include/boost/detail/winapi/GetCurrentThread.hpp similarity index 70% rename from include/boost/detail/win/GetCurrentThread.hpp rename to include/boost/detail/winapi/GetCurrentThread.hpp index cdc6d36..595b751 100644 --- a/include/boost/detail/win/GetCurrentThread.hpp +++ b/include/boost/detail/winapi/GetCurrentThread.hpp @@ -6,14 +6,18 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_GETCURRENTTHREAD_HPP -#define BOOST_DETAIL_WIN_GETCURRENTTHREAD_HPP +#ifndef BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP +#define BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP -#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 { +namespace winapi { #if defined( UNDER_CE ) // Windows CE define GetCurrentThread as an inline function in kfuncs.h inline HANDLE_ GetCurrentThread() @@ -31,4 +35,4 @@ inline HANDLE_ GetCurrentThread() } } -#endif // BOOST_DETAIL_WIN_TIME_HPP +#endif // BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP diff --git a/include/boost/detail/win/GetLastError.hpp b/include/boost/detail/winapi/GetLastError.hpp similarity index 63% rename from include/boost/detail/win/GetLastError.hpp rename to include/boost/detail/winapi/GetLastError.hpp index d040abf..6e9e2d9 100644 --- a/include/boost/detail/win/GetLastError.hpp +++ b/include/boost/detail/winapi/GetLastError.hpp @@ -6,14 +6,18 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_GETLASTERROR_HPP -#define BOOST_DETAIL_WIN_GETLASTERROR_HPP +#ifndef BOOST_DETAIL_WINAPI_GETLASTERROR_HPP +#define BOOST_DETAIL_WINAPI_GETLASTERROR_HPP -#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 { +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) using ::GetLastError; #else @@ -24,4 +28,4 @@ namespace win32 { } } -#endif // BOOST_DETAIL_WIN_TIME_HPP +#endif // BOOST_DETAIL_WINAPI_GETLASTERROR_HPP diff --git a/include/boost/detail/win/GetProcessTimes.hpp b/include/boost/detail/winapi/GetProcessTimes.hpp similarity index 73% rename from include/boost/detail/win/GetProcessTimes.hpp rename to include/boost/detail/winapi/GetProcessTimes.hpp index 8d76995..f2860b0 100644 --- a/include/boost/detail/win/GetProcessTimes.hpp +++ b/include/boost/detail/winapi/GetProcessTimes.hpp @@ -6,14 +6,18 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP -#define BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP +#ifndef BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP +#define BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP -#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 { +namespace winapi { #if !defined(UNDER_CE) // Windows CE does not define GetProcessTimes #if defined( BOOST_USE_WINDOWS_H ) using ::GetProcessTimes; @@ -32,4 +36,4 @@ namespace win32 { } } -#endif // BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP +#endif // BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP diff --git a/include/boost/detail/win/GetThreadTimes.hpp b/include/boost/detail/winapi/GetThreadTimes.hpp similarity index 71% rename from include/boost/detail/win/GetThreadTimes.hpp rename to include/boost/detail/winapi/GetThreadTimes.hpp index cf19c46..3428eda 100644 --- a/include/boost/detail/win/GetThreadTimes.hpp +++ b/include/boost/detail/winapi/GetThreadTimes.hpp @@ -6,14 +6,18 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_GETTHREADTIMES_HPP -#define BOOST_DETAIL_WIN_GETTHREADTIMES_HPP +#ifndef BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP +#define BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP -#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 { +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) using ::GetThreadTimes; #else @@ -30,4 +34,4 @@ namespace win32 { } } -#endif // BOOST_DETAIL_WIN_GETTHREADTIMES_HPP +#endif // BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP diff --git a/include/boost/detail/win/LocalFree.hpp b/include/boost/detail/winapi/LocalFree.hpp similarity index 67% rename from include/boost/detail/win/LocalFree.hpp rename to include/boost/detail/winapi/LocalFree.hpp index da1c77b..697016c 100644 --- a/include/boost/detail/win/LocalFree.hpp +++ b/include/boost/detail/winapi/LocalFree.hpp @@ -6,14 +6,18 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_LOCALFREE_HPP -#define BOOST_DETAIL_WIN_LOCALFREE_HPP +#ifndef BOOST_DETAIL_WINAPI_LOCALFREE_HPP +#define BOOST_DETAIL_WINAPI_LOCALFREE_HPP -#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 { +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) typedef HANDLE_ HLOCAL_; @@ -26,4 +30,4 @@ namespace win32 { } } } -#endif // BOOST_DETAIL_WIN_LOCALFREE_HPP +#endif // BOOST_DETAIL_WINAPI_LOCALFREE_HPP diff --git a/include/boost/detail/win/basic_types.hpp b/include/boost/detail/winapi/basic_types.hpp similarity index 92% rename from include/boost/detail/win/basic_types.hpp rename to include/boost/detail/winapi/basic_types.hpp index 79f6787..e9ca370 100644 --- a/include/boost/detail/win/basic_types.hpp +++ b/include/boost/detail/winapi/basic_types.hpp @@ -6,11 +6,13 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_BASIC_TYPES_HPP -#define BOOST_DETAIL_WIN_BASIC_TYPES_HPP +#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__) @@ -33,9 +35,13 @@ # error "Win32 functions not available" #endif +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + namespace boost { namespace detail { -namespace win32 { +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) typedef ::BOOL BOOL_; typedef ::WORD WORD_; @@ -102,10 +108,9 @@ extern "C" { typedef wchar_t WCHAR_; typedef WCHAR_ *LPWSTR_; typedef const WCHAR_ *LPCWSTR_; - } #endif } } } -#endif // BOOST_DETAIL_WIN_TIME_HPP +#endif // BOOST_DETAIL_WINAPI_TIME_HPP diff --git a/include/boost/detail/win/directory_management.hpp b/include/boost/detail/winapi/directory_management.hpp similarity index 74% rename from include/boost/detail/win/directory_management.hpp rename to include/boost/detail/winapi/directory_management.hpp index 1ffe659..19af1ee 100644 --- a/include/boost/detail/win/directory_management.hpp +++ b/include/boost/detail/winapi/directory_management.hpp @@ -6,17 +6,21 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_DIRECTORY_MANAGEMENT_HPP -#define BOOST_DETAIL_WIN_DIRECTORY_MANAGEMENT_HPP +#ifndef BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP +#define BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP -#include -#include +#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) using ::CreateDirectory; @@ -33,11 +37,10 @@ extern "C" { GetTempPathA(unsigned long length, char *buffer); __declspec(dllimport) int __stdcall RemoveDirectoryA(LPCTSTR_); - } #endif } } } -#endif // BOOST_DETAIL_WIN_THREAD_HPP +#endif // BOOST_DETAIL_WINAPI_THREAD_HPP diff --git a/include/boost/detail/win/dll.hpp b/include/boost/detail/winapi/dll.hpp similarity index 77% rename from include/boost/detail/win/dll.hpp rename to include/boost/detail/winapi/dll.hpp index 605a1bf..ed45272 100644 --- a/include/boost/detail/win/dll.hpp +++ b/include/boost/detail/winapi/dll.hpp @@ -6,17 +6,21 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_DLL_HPP -#define BOOST_DETAIL_WIN_DLL_HPP +#ifndef BOOST_DETAIL_WINAPI_DLL_HPP +#define BOOST_DETAIL_WINAPI_DLL_HPP -#include -#include +#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) using ::LoadLibrary; @@ -42,11 +46,10 @@ extern "C" { GetModuleHandleA( LPCSTR_ lpProcName ); - } #endif } } } -#endif // BOOST_DETAIL_WIN_THREAD_HPP +#endif // BOOST_DETAIL_WINAPI_THREAD_HPP diff --git a/include/boost/detail/win/error_handling.hpp b/include/boost/detail/winapi/error_handling.hpp similarity index 89% rename from include/boost/detail/win/error_handling.hpp rename to include/boost/detail/winapi/error_handling.hpp index d6fb428..fbe9924 100644 --- a/include/boost/detail/win/error_handling.hpp +++ b/include/boost/detail/winapi/error_handling.hpp @@ -6,15 +6,20 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_ERROR_HANDLING_HPP -#define BOOST_DETAIL_WIN_ERROR_HANDLING_HPP +#ifndef BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP +#define BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP -#include -#include +#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 { +namespace winapi { + #if defined( BOOST_USE_WINDOWS_H ) using ::FormatMessageA; using ::FormatMessageW; @@ -85,4 +90,4 @@ extern "C" { } } } -#endif // BOOST_DETAIL_WIN_ERROR_HANDLING_HPP +#endif // BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP diff --git a/include/boost/detail/win/file_management.hpp b/include/boost/detail/winapi/file_management.hpp similarity index 92% rename from include/boost/detail/win/file_management.hpp rename to include/boost/detail/winapi/file_management.hpp index 5cb0dbf..c1d5978 100644 --- a/include/boost/detail/win/file_management.hpp +++ b/include/boost/detail/winapi/file_management.hpp @@ -6,17 +6,21 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_FILE_MANAGEMENT_HPP -#define BOOST_DETAIL_WIN_FILE_MANAGEMENT_HPP +#ifndef BOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP +#define BOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP -#include -#include +#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) using ::CreateFileA; @@ -123,4 +127,4 @@ extern "C" { } } -#endif // BOOST_DETAIL_WIN_THREAD_HPP +#endif // BOOST_DETAIL_WINAPI_THREAD_HPP diff --git a/include/boost/detail/win/handles.hpp b/include/boost/detail/winapi/handles.hpp similarity index 71% rename from include/boost/detail/win/handles.hpp rename to include/boost/detail/winapi/handles.hpp index 1441d10..d4cffc8 100644 --- a/include/boost/detail/win/handles.hpp +++ b/include/boost/detail/winapi/handles.hpp @@ -6,17 +6,20 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_HANDLES_HPP -#define BOOST_DETAIL_WIN_HANDLES_HPP +#ifndef BOOST_DETAIL_WINAPI_HANDLES_HPP +#define BOOST_DETAIL_WINAPI_HANDLES_HPP -#include +#include +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) using ::CloseHandle; @@ -34,4 +37,4 @@ extern "C" { } } -#endif // BOOST_DETAIL_WIN_HANDLES_HPP +#endif // BOOST_DETAIL_WINAPI_HANDLES_HPP diff --git a/include/boost/detail/win/memory.hpp b/include/boost/detail/winapi/memory.hpp similarity index 80% rename from include/boost/detail/win/memory.hpp rename to include/boost/detail/winapi/memory.hpp index 8bf59ad..b5316e0 100644 --- a/include/boost/detail/win/memory.hpp +++ b/include/boost/detail/winapi/memory.hpp @@ -6,19 +6,22 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_MEMORY_HPP -#define BOOST_DETAIL_WIN_MEMORY_HPP +#ifndef BOOST_DETAIL_WINAPI_MEMORY_HPP +#define BOOST_DETAIL_WINAPI_MEMORY_HPP -#include -#include -#include +#include +#include +#include +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) using ::CreateFileMappingA; @@ -30,9 +33,7 @@ namespace win32 using ::OpenFileMappingA; using ::UnmapViewOfFile; #else -# ifdef HeapAlloc -# undef HeapAlloc -# endif +#undef HeapAlloc extern "C" { __declspec(dllimport) void * __stdcall CreateFileMappingA (void *, SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, unsigned long, const char *); @@ -56,4 +57,4 @@ extern "C" { } } -#endif // BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP +#endif // BOOST_DETAIL_WINAPI_MEMORY_HPP diff --git a/include/boost/detail/win/process.hpp b/include/boost/detail/winapi/process.hpp similarity index 64% rename from include/boost/detail/win/process.hpp rename to include/boost/detail/winapi/process.hpp index 10c3a93..411ffaf 100644 --- a/include/boost/detail/win/process.hpp +++ b/include/boost/detail/winapi/process.hpp @@ -6,15 +6,19 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_PROCESS_HPP -#define BOOST_DETAIL_WIN_PROCESS_HPP +#ifndef BOOST_DETAIL_WINAPI_PROCESS_HPP +#define BOOST_DETAIL_WINAPI_PROCESS_HPP -#include -#include +#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 { +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) using ::GetCurrentProcessId; #else @@ -30,4 +34,4 @@ extern "C" { } } } -#endif // BOOST_DETAIL_WIN_PROCESS_HPP +#endif // BOOST_DETAIL_WINAPI_PROCESS_HPP diff --git a/include/boost/detail/win/security.hpp b/include/boost/detail/winapi/security.hpp similarity index 85% rename from include/boost/detail/win/security.hpp rename to include/boost/detail/winapi/security.hpp index ee38985..79925c6 100644 --- a/include/boost/detail/win/security.hpp +++ b/include/boost/detail/winapi/security.hpp @@ -6,17 +6,20 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_SECURITY_HPP -#define BOOST_DETAIL_WIN_SECURITY_HPP +#ifndef BOOST_DETAIL_WINAPI_SECURITY_HPP +#define BOOST_DETAIL_WINAPI_SECURITY_HPP -#include +#include +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) typedef ::SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES_; @@ -59,4 +62,4 @@ extern "C" { } } -#endif // BOOST_DETAIL_WIN_SECURITY_HPP +#endif // BOOST_DETAIL_WINAPI_SECURITY_HPP diff --git a/include/boost/detail/win/synchronization.hpp b/include/boost/detail/winapi/synchronization.hpp similarity index 78% rename from include/boost/detail/win/synchronization.hpp rename to include/boost/detail/winapi/synchronization.hpp index 391e0ef..5d3327a 100644 --- a/include/boost/detail/win/synchronization.hpp +++ b/include/boost/detail/winapi/synchronization.hpp @@ -6,17 +6,20 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP -#define BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP +#ifndef BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP +#define BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP -#include +#include +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) typedef ::CRITICAL_SECTION CRITICAL_SECTION_; @@ -47,17 +50,16 @@ namespace win32 using ::WaitForSingleObject; using ::QueueUserAPC; - enum - { - infinite = INFINITE, - wait_abandoned = WAIT_ABANDONED, - wait_object_0 = WAIT_OBJECT_0, - wait_timeout = WAIT_TIMEOUT, - wait_failed = WAIT_FAILED - }; + 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; + +#else // defined( BOOST_USE_WINDOWS_H ) -#else extern "C" { + struct CRITICAL_SECTION_ { struct critical_section_debug * DebugInfo; @@ -114,9 +116,9 @@ extern "C" { unsigned long dwMilliseconds); __declspec(dllimport) int __stdcall ReleaseSemaphore(void*,long,long*); - typedef void (__stdcall *PAPCFUNC8)(ulong_ptr); + typedef void (__stdcall *PAPCFUNC8)(ULONG_PTR_); __declspec(dllimport) unsigned long __stdcall - QueueUserAPC(PAPCFUNC8,void*,ulong_ptr); + QueueUserAPC(PAPCFUNC8,void*,ULONG_PTR_); # ifndef UNDER_CE __declspec(dllimport) int __stdcall SetEvent(void*); @@ -125,21 +127,20 @@ extern "C" { # else using ::SetEvent; using ::ResetEvent; - - enum - { - infinite = (DWORD_)0xFFFFFFFF, - wait_abandoned = 0x00000080L, - wait_object_0 = 0x00000000L, - wait_timeout = 0x00000102L, - wait_failed = (DWORD_)0xFFFFFFFF - }; - # endif -} -#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; + +#endif // defined( BOOST_USE_WINDOWS_H ) + } } } -#endif // BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP +#endif // BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP diff --git a/include/boost/detail/win/system.hpp b/include/boost/detail/winapi/system.hpp similarity index 75% rename from include/boost/detail/win/system.hpp rename to include/boost/detail/winapi/system.hpp index 3bcffce..35b6682 100644 --- a/include/boost/detail/win/system.hpp +++ b/include/boost/detail/winapi/system.hpp @@ -6,19 +6,21 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_SYSTEM_HPP -#define BOOST_DETAIL_WIN_SYSTEM_HPP -#include -#include +#ifndef BOOST_DETAIL_WINAPI_SYSTEM_HPP +#define BOOST_DETAIL_WINAPI_SYSTEM_HPP -#include -extern "C" __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *); +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 { +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) typedef ::SYSTEM_INFO SYSTEM_INFO_; + extern "C" __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *); #else extern "C" { typedef struct _SYSTEM_INFO { @@ -47,4 +49,4 @@ extern "C" { } } } -#endif // BOOST_DETAIL_WIN_TIME_HPP +#endif // BOOST_DETAIL_WINAPI_SYSTEM_HPP diff --git a/include/boost/detail/win/thread.hpp b/include/boost/detail/winapi/thread.hpp similarity index 73% rename from include/boost/detail/win/thread.hpp rename to include/boost/detail/winapi/thread.hpp index 4e1bf30..3c1be66 100644 --- a/include/boost/detail/win/thread.hpp +++ b/include/boost/detail/winapi/thread.hpp @@ -6,17 +6,21 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_THREAD_HPP -#define BOOST_DETAIL_WIN_THREAD_HPP +#ifndef BOOST_DETAIL_WINAPI_THREAD_HPP +#define BOOST_DETAIL_WINAPI_THREAD_HPP -#include -#include +#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) using ::GetCurrentThreadId; @@ -42,4 +46,4 @@ extern "C" { } } -#endif // BOOST_DETAIL_WIN_THREAD_HPP +#endif // BOOST_DETAIL_WINAPI_THREAD_HPP diff --git a/include/boost/detail/win/time.hpp b/include/boost/detail/winapi/time.hpp similarity index 89% rename from include/boost/detail/win/time.hpp rename to include/boost/detail/winapi/time.hpp index b0adfa7..b3e4c44 100644 --- a/include/boost/detail/win/time.hpp +++ b/include/boost/detail/winapi/time.hpp @@ -6,15 +6,18 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_TIME_HPP -#define BOOST_DETAIL_WIN_TIME_HPP +#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 win32 { +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) typedef FILETIME FILETIME_; typedef PFILETIME PFILETIME_; @@ -79,4 +82,4 @@ inline void WINAPI GetSystemTimeAsFileTime(FILETIME_* lpFileTime) } } -#endif // BOOST_DETAIL_WIN_TIME_HPP +#endif // BOOST_DETAIL_WINAPI_TIME_HPP diff --git a/include/boost/detail/win/timers.hpp b/include/boost/detail/winapi/timers.hpp similarity index 74% rename from include/boost/detail/win/timers.hpp rename to include/boost/detail/winapi/timers.hpp index 753c91f..04c6dfb 100644 --- a/include/boost/detail/win/timers.hpp +++ b/include/boost/detail/winapi/timers.hpp @@ -6,17 +6,20 @@ // See http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_DETAIL_WIN_TIMERS_HPP -#define BOOST_DETAIL_WIN_TIMERS_HPP +#ifndef BOOST_DETAIL_WINAPI_TIMERS_HPP +#define BOOST_DETAIL_WINAPI_TIMERS_HPP -#include +#include +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif namespace boost { namespace detail { -namespace win32 +namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) using ::QueryPerformanceCounter; @@ -38,4 +41,4 @@ extern "C" { } } -#endif // BOOST_DETAIL_WIN_TIMERS_HPP +#endif // BOOST_DETAIL_WINAPI_TIMERS_HPP