mirror of
https://github.com/boostorg/detail.git
synced 2025-06-28 13:31:05 +02:00
Compare commits
30 Commits
svn-branch
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
7fd78917eb | |||
41e2470d21 | |||
eb60febe83 | |||
ce5864b47e | |||
8590e40965 | |||
e1e8b05e02 | |||
79bce0a5f2 | |||
6a98633c6c | |||
81cbc142ac | |||
bd58c2d229 | |||
19ca421f24 | |||
538f8f7b3b | |||
ae93c52b75 | |||
eb6208f69a | |||
d5aa8a952a | |||
dc1a439ec0 | |||
c77e8e89cf | |||
2ea55870e4 | |||
112b2471b7 | |||
2cbdcde368 | |||
67f78550e5 | |||
5973a2bcef | |||
d8159674fa | |||
0c7444b84f | |||
804546aacf | |||
b39e23464b | |||
0e2bc0d9f4 | |||
9378f3d4f7 | |||
20332e24e5 | |||
2a116b4ea4 |
@ -1,78 +1,11 @@
|
|||||||
// Copyright 2005 Caleb Epstein
|
// Copyright 2013 Redshift Software Inc
|
||||||
// Copyright 2006 John Maddock
|
|
||||||
// Copyright 2010 Rene Rivera
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See accompany-
|
// 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)
|
// 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 <boost/detail/limits.hpp>, from
|
|
||||||
* which this code was originally taken.
|
|
||||||
*
|
|
||||||
* Modified by Caleb Epstein to use <endian.h> with GNU libc and to
|
|
||||||
* defined the BOOST_ENDIAN macro.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_ENDIAN_HPP
|
#ifndef BOOST_DETAIL_ENDIAN_HPP
|
||||||
#define BOOST_DETAIL_ENDIAN_HPP
|
#define BOOST_DETAIL_ENDIAN_HPP
|
||||||
|
|
||||||
// GNU libc offers the helpful header <endian.h> which defines
|
// Use the Predef library for the detection of endianess.
|
||||||
// __BYTE_ORDER
|
#include <boost/predef/detail/endian_compat.h>
|
||||||
|
|
||||||
#if defined (__GLIBC__)
|
|
||||||
# include <endian.h>
|
|
||||||
# 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)
|
|
||||||
# define BOOST_BIG_ENDIAN
|
|
||||||
# define BOOST_BYTE_ORDER 4321
|
|
||||||
#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) || \
|
|
||||||
defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) || \
|
|
||||||
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__)
|
|
||||||
# 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__)
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
#ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
|
#ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
|
||||||
#define BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
|
#define BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// boost/detail/interlocked.hpp
|
// boost/detail/interlocked.hpp
|
||||||
//
|
//
|
||||||
@ -19,6 +13,11 @@
|
|||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
|
// MS compatible compilers support #pragma once
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
@ -33,6 +32,21 @@
|
|||||||
|
|
||||||
#elif defined(_WIN32_WCE)
|
#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 );
|
||||||
|
|
||||||
|
# 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
|
// under Windows CE we still have old-style Interlocked* functions
|
||||||
|
|
||||||
extern "C" long __cdecl InterlockedIncrement( long* );
|
extern "C" long __cdecl InterlockedIncrement( long* );
|
||||||
@ -47,6 +61,8 @@ extern "C" long __cdecl InterlockedExchangeAdd( long*, long );
|
|||||||
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
|
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
|
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
|
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
|
||||||
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long*)(dest),(long)(exchange),(long)(compare)))
|
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long*)(dest),(long)(exchange),(long)(compare)))
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
|
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
|
||||||
@ -54,7 +70,7 @@ extern "C" long __cdecl InterlockedExchangeAdd( long*, long );
|
|||||||
|
|
||||||
#elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )
|
#elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )
|
||||||
|
|
||||||
#if defined( BOOST_MSVC ) && BOOST_MSVC >= 1600
|
#if defined( BOOST_MSVC ) && BOOST_MSVC >= 1500
|
||||||
|
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
|
|
||||||
@ -108,14 +124,30 @@ extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* );
|
|||||||
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
|
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
|
# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
|
||||||
|
|
||||||
|
// Unlike __MINGW64__, __MINGW64_VERSION_MAJOR is defined by MinGW-w64 for both 32 and 64-bit targets.
|
||||||
|
#elif defined(__MINGW64_VERSION_MAJOR)
|
||||||
|
|
||||||
|
// MinGW-w64 provides intrin.h for both 32 and 64-bit targets.
|
||||||
|
#include <intrin.h>
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# if defined(__x86_64__) || defined(__x86_64)
|
||||||
|
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer
|
||||||
|
# define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer
|
||||||
|
# else
|
||||||
|
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
|
||||||
|
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
|
||||||
|
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
|
||||||
|
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
|
||||||
|
# endif
|
||||||
|
|
||||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
|
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
|
||||||
|
|
||||||
#if defined(__MINGW64__)
|
|
||||||
#define BOOST_INTERLOCKED_IMPORT
|
|
||||||
#else
|
|
||||||
#define BOOST_INTERLOCKED_IMPORT __declspec(dllimport)
|
#define BOOST_INTERLOCKED_IMPORT __declspec(dllimport)
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
@ -112,7 +112,7 @@ boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
#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()
|
#include BOOST_PP_ITERATE()
|
||||||
|
|
||||||
#endif // BOOST_TT_PREPROCESSING_MODE
|
#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
|
#undef i
|
||||||
#endif // BOOST_PP_IS_ITERATING
|
#endif // BOOST_PP_IS_ITERATING
|
||||||
|
|
||||||
|
@ -12,21 +12,61 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) 2002, 2009 Peter Dimov
|
// Copyright (c) 2002, 2009 Peter Dimov
|
||||||
// Copyright (2) Beman Dawes 2010, 2011
|
// Copyright (2) Beman Dawes 2010, 2011
|
||||||
|
// Copyright (3) Ion Gaztanaga 2013
|
||||||
//
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// See accompanying file LICENSE_1_0.txt or copy at
|
// See accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt
|
// 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)
|
// BOOST_TEST(expression)
|
||||||
|
//
|
||||||
|
// ---------------
|
||||||
|
//
|
||||||
|
// Increases error count and outputs a message containing 'message'
|
||||||
|
//
|
||||||
// BOOST_ERROR(message)
|
// BOOST_ERROR(message)
|
||||||
|
//
|
||||||
|
// ---------------
|
||||||
|
//
|
||||||
|
// If 'expr1' != 'expr2' increases the error count
|
||||||
|
// and outputs a message containing both expressions
|
||||||
|
//
|
||||||
// BOOST_TEST_EQ(expr1, expr2)
|
// 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()
|
// int boost::report_errors()
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <boost/current_function.hpp>
|
#include <boost/current_function.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
|
#include <boost/detail/no_exceptions_support.hpp>
|
||||||
|
|
||||||
// IDE's like Visual Studio perform better if output goes to std::cout or
|
// IDE's like Visual Studio perform better if output goes to std::cout or
|
||||||
// some other stream, so allow user to configure output stream:
|
// 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();
|
++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<class T, class U> inline void test_eq_impl( char const * expr1, char const * expr2,
|
template<class T, class U> 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 )
|
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_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_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) )
|
#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
|
#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
|
||||||
|
@ -1,56 +1,337 @@
|
|||||||
// scoped_enum_emulation.hpp ---------------------------------------------------------//
|
// scoped_enum_emulation.hpp ---------------------------------------------------------//
|
||||||
|
|
||||||
// Copyright Beman Dawes, 2009
|
// Copyright Beman Dawes, 2009
|
||||||
|
// Copyright (C) 2011-2012 Vicente J. Botet Escriba
|
||||||
|
// Copyright (C) 2012 Anthony Williams
|
||||||
|
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// 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
|
[section:scoped_enums Scoped Enums]
|
||||||
// macro is used to detect feature support.
|
|
||||||
//
|
Generates C++0x scoped enums if the feature is present, otherwise emulates C++0x
|
||||||
// See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf for a
|
scoped enums with C++03 namespaces and enums. The Boost.Config BOOST_NO_CXX11_SCOPED_ENUMS
|
||||||
// description of the scoped enum feature. Note that the committee changed the name
|
macro is used to detect feature support.
|
||||||
// from strongly typed enum to scoped enum.
|
|
||||||
//
|
See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf for a
|
||||||
// Caution: only the syntax is emulated; the semantics are not emulated and
|
description of the scoped enum feature. Note that the committee changed the name
|
||||||
// the syntax emulation doesn't include being able to specify the underlying
|
from strongly typed enum to scoped enum.
|
||||||
// representation type.
|
|
||||||
//
|
Some of the enumerations defined in the standard library are scoped enums.
|
||||||
// The emulation is via struct rather than namespace to allow use within classes.
|
|
||||||
// Thanks to Andrey Semashev for pointing that out.
|
enum class future_errc
|
||||||
//
|
{
|
||||||
// Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott,
|
broken_promise,
|
||||||
// Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, Matt Calabrese, Vincente
|
future_already_retrieved,
|
||||||
// Botet, and Daniel James.
|
promise_already_satisfied,
|
||||||
//
|
no_state
|
||||||
// Sample usage:
|
};
|
||||||
//
|
|
||||||
// BOOST_SCOPED_ENUM_START(algae) { green, red, cyan }; BOOST_SCOPED_ENUM_END
|
On compilers that don't support them, the library provides two emulations:
|
||||||
// ...
|
|
||||||
// BOOST_SCOPED_ENUM(algae) sample( algae::red );
|
[heading Strict]
|
||||||
// void foo( BOOST_SCOPED_ENUM(algae) color );
|
|
||||||
// ...
|
* Able to specify the underlying type.
|
||||||
// sample = algae::green;
|
* explicit conversion to/from underlying type.
|
||||||
// foo( algae::cyan );
|
* 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<future_errc>' will be false_type.
|
||||||
|
* The emulated scoped enum can not be used in switch nor in template arguments. For these cases the user needs to use some macros.
|
||||||
|
|
||||||
|
Instead of
|
||||||
|
|
||||||
|
switch (ev)
|
||||||
|
{
|
||||||
|
case future_errc::broken_promise:
|
||||||
|
// ...
|
||||||
|
|
||||||
|
use
|
||||||
|
|
||||||
|
switch (boost::native_value(ev))
|
||||||
|
{
|
||||||
|
case future_errc::broken_promise:
|
||||||
|
|
||||||
|
And instead of
|
||||||
|
|
||||||
|
#ifdef BOOST_NO_CXX11_SCOPED_ENUMS
|
||||||
|
template <>
|
||||||
|
struct BOOST_SYMBOL_VISIBLE is_error_code_enum<future_errc> : public true_type { };
|
||||||
|
#endif
|
||||||
|
|
||||||
|
use
|
||||||
|
|
||||||
|
#ifdef BOOST_NO_CXX11_SCOPED_ENUMS
|
||||||
|
template <>
|
||||||
|
struct BOOST_SYMBOL_VISIBLE is_error_code_enum<future_errc::enum_type > : 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
|
#ifndef BOOST_SCOPED_ENUM_EMULATION_HPP
|
||||||
#define BOOST_SCOPED_ENUM_EMULATION_HPP
|
#define BOOST_SCOPED_ENUM_EMULATION_HPP
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
#ifdef BOOST_NO_SCOPED_ENUMS
|
namespace boost
|
||||||
|
{
|
||||||
|
|
||||||
# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_type
|
#ifdef BOOST_NO_CXX11_SCOPED_ENUMS
|
||||||
# define BOOST_SCOPED_ENUM_END };
|
/**
|
||||||
# define BOOST_SCOPED_ENUM(name) name::enum_type
|
* 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 <typename EnumType>
|
||||||
|
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<EnumType>::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 <typename EnumType>
|
||||||
|
struct native_type
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The member typedef type names the native enum type associated to the scoped enum,
|
||||||
|
* which is it self if the compiler supports scoped enums or EnumType::enum_type if it is an emulated scoped enum.
|
||||||
|
*/
|
||||||
|
typedef typename EnumType::enum_type type;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Casts a scoped enum to its underlying type.
|
||||||
|
*
|
||||||
|
* This function is useful when working with scoped enum classes, which doens't implicitly convert to the underlying type.
|
||||||
|
* @param v A scoped enum.
|
||||||
|
* @returns The underlying type.
|
||||||
|
* @throws No-throws.
|
||||||
|
*/
|
||||||
|
template <typename UnderlyingType, typename EnumType>
|
||||||
|
UnderlyingType underlying_cast(EnumType v)
|
||||||
|
{
|
||||||
|
return v.get_underlying_value_();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Casts a scoped enum to its native enum type.
|
||||||
|
*
|
||||||
|
* This function is useful to make programs portable when the scoped enum emulation can not be use where native enums can.
|
||||||
|
*
|
||||||
|
* EnumType the scoped enum type
|
||||||
|
*
|
||||||
|
* @param v A scoped enum.
|
||||||
|
* @returns The native enum value.
|
||||||
|
* @throws No-throws.
|
||||||
|
*/
|
||||||
|
template <typename EnumType>
|
||||||
|
inline
|
||||||
|
typename EnumType::enum_type native_value(EnumType e)
|
||||||
|
{
|
||||||
|
return e.native_value_();
|
||||||
|
}
|
||||||
|
|
||||||
|
#else // BOOST_NO_CXX11_SCOPED_ENUMS
|
||||||
|
|
||||||
|
template <typename EnumType>
|
||||||
|
struct underlying_type
|
||||||
|
{
|
||||||
|
//typedef typename std::underlying_type<EnumType>::type type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename EnumType>
|
||||||
|
struct native_type
|
||||||
|
{
|
||||||
|
typedef EnumType type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename UnderlyingType, typename EnumType>
|
||||||
|
UnderlyingType underlying_cast(EnumType v)
|
||||||
|
{
|
||||||
|
return static_cast<UnderlyingType>(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename EnumType>
|
||||||
|
inline
|
||||||
|
EnumType native_value(EnumType e)
|
||||||
|
{
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef BOOST_NO_CXX11_SCOPED_ENUMS
|
||||||
|
|
||||||
|
#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
|
||||||
|
|
||||||
|
#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
|
||||||
|
explicit operator underlying_type() const { return get_underlying_value_(); }
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
# define BOOST_SCOPED_ENUM_START(name) enum class name
|
#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR
|
||||||
# define BOOST_SCOPED_ENUM_END
|
|
||||||
# define BOOST_SCOPED_ENUM(name) name
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start a declaration of a scoped enum.
|
||||||
|
*
|
||||||
|
* @param EnumType The new scoped enum.
|
||||||
|
* @param UnderlyingType The underlying type.
|
||||||
|
*/
|
||||||
|
#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType, UnderlyingType) \
|
||||||
|
struct EnumType { \
|
||||||
|
typedef UnderlyingType underlying_type; \
|
||||||
|
EnumType() BOOST_NOEXCEPT {} \
|
||||||
|
explicit EnumType(underlying_type v) : v_(v) {} \
|
||||||
|
underlying_type get_underlying_value_() const { return v_; } \
|
||||||
|
BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
|
||||||
|
private: \
|
||||||
|
underlying_type v_; \
|
||||||
|
typedef EnumType self_type; \
|
||||||
|
public: \
|
||||||
|
enum enum_type
|
||||||
|
|
||||||
|
#define BOOST_SCOPED_ENUM_DECLARE_END2() \
|
||||||
|
enum_type get_native_value_() const BOOST_NOEXCEPT { return enum_type(v_); } \
|
||||||
|
operator enum_type() const BOOST_NOEXCEPT { return get_native_value_(); } \
|
||||||
|
friend bool operator ==(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==enum_type(rhs.v_); } \
|
||||||
|
friend bool operator ==(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==rhs; } \
|
||||||
|
friend bool operator ==(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs==enum_type(rhs.v_); } \
|
||||||
|
friend bool operator !=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=enum_type(rhs.v_); } \
|
||||||
|
friend bool operator !=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=rhs; } \
|
||||||
|
friend bool operator !=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs!=enum_type(rhs.v_); } \
|
||||||
|
friend bool operator <(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<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_)>enum_type(rhs.v_); } \
|
||||||
|
friend bool operator >(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>rhs; } \
|
||||||
|
friend bool operator >(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>enum_type(rhs.v_); } \
|
||||||
|
friend bool operator >=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=enum_type(rhs.v_); } \
|
||||||
|
friend bool operator >=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=rhs; } \
|
||||||
|
friend bool operator >=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>=enum_type(rhs.v_); } \
|
||||||
|
};
|
||||||
|
|
||||||
|
#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) \
|
||||||
|
; \
|
||||||
|
EnumType(enum_type v) BOOST_NOEXCEPT : v_(v) {} \
|
||||||
|
BOOST_SCOPED_ENUM_DECLARE_END2()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts a declaration of a scoped enum with the default int underlying type.
|
||||||
|
*
|
||||||
|
* @param EnumType The new scoped enum.
|
||||||
|
*/
|
||||||
|
#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) \
|
||||||
|
BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,int)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name of the native enum type.
|
||||||
|
*
|
||||||
|
* @param NT The new scoped enum.
|
||||||
|
*/
|
||||||
|
#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType::enum_type
|
||||||
|
/**
|
||||||
|
* Forward declares an scoped enum.
|
||||||
|
*
|
||||||
|
* @param NT The scoped enum.
|
||||||
|
*/
|
||||||
|
#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) struct EnumType
|
||||||
|
|
||||||
|
#else // BOOST_NO_CXX11_SCOPED_ENUMS
|
||||||
|
|
||||||
|
#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,UnderlyingType) enum class EnumType:UnderlyingType
|
||||||
|
#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) enum class EnumType
|
||||||
|
#define BOOST_SCOPED_ENUM_DECLARE_END2()
|
||||||
|
#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) ;
|
||||||
|
|
||||||
|
#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType
|
||||||
|
#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) enum class EnumType
|
||||||
|
|
||||||
|
#endif // BOOST_NO_CXX11_SCOPED_ENUMS
|
||||||
|
|
||||||
|
#define BOOST_SCOPED_ENUM_START(name) BOOST_SCOPED_ENUM_DECLARE_BEGIN(name)
|
||||||
|
#define BOOST_SCOPED_ENUM_END BOOST_SCOPED_ENUM_DECLARE_END2()
|
||||||
|
#define BOOST_SCOPED_ENUM(name) BOOST_SCOPED_ENUM_NATIVE(name)
|
||||||
|
|
||||||
|
//#ifdef BOOST_NO_CXX11_SCOPED_ENUMS
|
||||||
|
//
|
||||||
|
//# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_type
|
||||||
|
//# define BOOST_SCOPED_ENUM_END };
|
||||||
|
//# define BOOST_SCOPED_ENUM(name) name::enum_type
|
||||||
|
//
|
||||||
|
//#else
|
||||||
|
//
|
||||||
|
//# define BOOST_SCOPED_ENUM_START(name) enum class name
|
||||||
|
//# define BOOST_SCOPED_ENUM_END
|
||||||
|
//# define BOOST_SCOPED_ENUM(name) name
|
||||||
|
//
|
||||||
|
//#endif
|
||||||
#endif // BOOST_SCOPED_ENUM_EMULATION_HPP
|
#endif // BOOST_SCOPED_ENUM_EMULATION_HPP
|
||||||
|
@ -92,8 +92,7 @@ namespace std {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) \
|
#if defined(_CPPLIB_VER) && (_CPPLIB_VER < 540)
|
||||||
&& !defined(_LIBCPP_VERSION)
|
|
||||||
#define BOOST_CODECVT_DO_LENGTH_CONST const
|
#define BOOST_CODECVT_DO_LENGTH_CONST const
|
||||||
#else
|
#else
|
||||||
#define BOOST_CODECVT_DO_LENGTH_CONST
|
#define BOOST_CODECVT_DO_LENGTH_CONST
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
/////////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)
|
// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
|
||||||
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
|
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
|
@ -6,14 +6,18 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_GETCURRENTPROCESS_HPP
|
#ifndef BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP
|
||||||
#define BOOST_DETAIL_WIN_GETCURRENTPROCESS_HPP
|
#define BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace win32 {
|
namespace winapi {
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
using ::GetCurrentProcess;
|
using ::GetCurrentProcess;
|
||||||
#else
|
#else
|
||||||
@ -22,4 +26,4 @@ namespace win32 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
#endif // BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP
|
@ -6,19 +6,23 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_GETCURRENTTHREAD_HPP
|
#ifndef BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
|
||||||
#define BOOST_DETAIL_WIN_GETCURRENTTHREAD_HPP
|
#define BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace win32 {
|
namespace winapi {
|
||||||
#if defined( UNDER_CE )
|
#if defined( UNDER_CE )
|
||||||
// Windows CE define GetCurrentThread as an inline function in kfuncs.h
|
// Windows CE define GetCurrentThread as an inline function in kfuncs.h
|
||||||
inline HANDLE_ GetCurrentThread()
|
inline HANDLE_ GetCurrentThread()
|
||||||
{
|
{
|
||||||
return ::GetCurrentThread();
|
return ::GetCurrentThread();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
@ -31,4 +35,4 @@ inline HANDLE_ GetCurrentThread()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
#endif // BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
|
@ -6,14 +6,18 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_GETLASTERROR_HPP
|
#ifndef BOOST_DETAIL_WINAPI_GETLASTERROR_HPP
|
||||||
#define BOOST_DETAIL_WIN_GETLASTERROR_HPP
|
#define BOOST_DETAIL_WINAPI_GETLASTERROR_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace win32 {
|
namespace winapi {
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
using ::GetLastError;
|
using ::GetLastError;
|
||||||
#else
|
#else
|
||||||
@ -24,4 +28,4 @@ namespace win32 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
#endif // BOOST_DETAIL_WINAPI_GETLASTERROR_HPP
|
@ -6,15 +6,19 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP
|
#ifndef BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP
|
||||||
#define BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP
|
#define BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/time.hpp>
|
#include <boost/detail/winapi/time.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace win32 {
|
namespace winapi {
|
||||||
#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 )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
using ::GetProcessTimes;
|
using ::GetProcessTimes;
|
||||||
#else
|
#else
|
||||||
@ -32,4 +36,4 @@ namespace win32 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP
|
#endif // BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP
|
@ -6,14 +6,18 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_GETTHREADTIMES_HPP
|
#ifndef BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP
|
||||||
#define BOOST_DETAIL_WIN_GETTHREADTIMES_HPP
|
#define BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/time.hpp>
|
#include <boost/detail/winapi/time.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace win32 {
|
namespace winapi {
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
using ::GetThreadTimes;
|
using ::GetThreadTimes;
|
||||||
#else
|
#else
|
||||||
@ -30,4 +34,4 @@ namespace win32 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_WIN_GETTHREADTIMES_HPP
|
#endif // BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP
|
@ -6,14 +6,18 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_LOCALFREE_HPP
|
#ifndef BOOST_DETAIL_WINAPI_LOCALFREE_HPP
|
||||||
#define BOOST_DETAIL_WIN_LOCALFREE_HPP
|
#define BOOST_DETAIL_WINAPI_LOCALFREE_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace win32 {
|
namespace winapi {
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
typedef HANDLE_ HLOCAL_;
|
typedef HANDLE_ HLOCAL_;
|
||||||
|
|
||||||
@ -26,4 +30,4 @@ namespace win32 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // BOOST_DETAIL_WIN_LOCALFREE_HPP
|
#endif // BOOST_DETAIL_WINAPI_LOCALFREE_HPP
|
@ -6,15 +6,17 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_BASIC_TYPES_HPP
|
#ifndef BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP
|
||||||
#define BOOST_DETAIL_WIN_BASIC_TYPES_HPP
|
#define BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#include <boost/cstdint.hpp>
|
#include <boost/cstdint.hpp>
|
||||||
|
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__)
|
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__)
|
||||||
# include <WinError.h>
|
# include <winerror.h>
|
||||||
// @FIXME Which condition must be tested
|
// @FIXME Which condition must be tested
|
||||||
# ifdef UNDER_CE
|
# ifdef UNDER_CE
|
||||||
# ifndef WINAPI
|
# ifndef WINAPI
|
||||||
@ -33,9 +35,13 @@
|
|||||||
# error "Win32 functions not available"
|
# error "Win32 functions not available"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace win32 {
|
namespace winapi {
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
typedef ::BOOL BOOL_;
|
typedef ::BOOL BOOL_;
|
||||||
typedef ::WORD WORD_;
|
typedef ::WORD WORD_;
|
||||||
@ -102,10 +108,9 @@ extern "C" {
|
|||||||
typedef wchar_t WCHAR_;
|
typedef wchar_t WCHAR_;
|
||||||
typedef WCHAR_ *LPWSTR_;
|
typedef WCHAR_ *LPWSTR_;
|
||||||
typedef const WCHAR_ *LPCWSTR_;
|
typedef const WCHAR_ *LPCWSTR_;
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
#endif // BOOST_DETAIL_WINAPI_TIME_HPP
|
@ -6,17 +6,21 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_DIRECTORY_MANAGEMENT_HPP
|
#ifndef BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP
|
||||||
#define BOOST_DETAIL_WIN_DIRECTORY_MANAGEMENT_HPP
|
#define BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
#include <boost/detail/win/security.hpp>
|
#include <boost/detail/winapi/security.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
namespace win32
|
namespace winapi
|
||||||
{
|
{
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
using ::CreateDirectory;
|
using ::CreateDirectory;
|
||||||
@ -33,11 +37,10 @@ extern "C" {
|
|||||||
GetTempPathA(unsigned long length, char *buffer);
|
GetTempPathA(unsigned long length, char *buffer);
|
||||||
__declspec(dllimport) int __stdcall
|
__declspec(dllimport) int __stdcall
|
||||||
RemoveDirectoryA(LPCTSTR_);
|
RemoveDirectoryA(LPCTSTR_);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_WIN_THREAD_HPP
|
#endif // BOOST_DETAIL_WINAPI_THREAD_HPP
|
@ -6,17 +6,21 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_DLL_HPP
|
#ifndef BOOST_DETAIL_WINAPI_DLL_HPP
|
||||||
#define BOOST_DETAIL_WIN_DLL_HPP
|
#define BOOST_DETAIL_WINAPI_DLL_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
#include <boost/detail/win/security.hpp>
|
#include <boost/detail/winapi/security.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
namespace win32
|
namespace winapi
|
||||||
{
|
{
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
using ::LoadLibrary;
|
using ::LoadLibrary;
|
||||||
@ -42,11 +46,10 @@ extern "C" {
|
|||||||
GetModuleHandleA(
|
GetModuleHandleA(
|
||||||
LPCSTR_ lpProcName
|
LPCSTR_ lpProcName
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_WIN_THREAD_HPP
|
#endif // BOOST_DETAIL_WINAPI_THREAD_HPP
|
@ -6,15 +6,20 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_ERROR_HANDLING_HPP
|
#ifndef BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP
|
||||||
#define BOOST_DETAIL_WIN_ERROR_HANDLING_HPP
|
#define BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
#include <boost/detail/win/GetCurrentThread.hpp>
|
#include <boost/detail/winapi/GetCurrentThread.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace win32 {
|
namespace winapi {
|
||||||
|
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
using ::FormatMessageA;
|
using ::FormatMessageA;
|
||||||
using ::FormatMessageW;
|
using ::FormatMessageW;
|
||||||
@ -85,4 +90,4 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // BOOST_DETAIL_WIN_ERROR_HANDLING_HPP
|
#endif // BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP
|
@ -6,17 +6,21 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_FILE_MANAGEMENT_HPP
|
#ifndef BOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP
|
||||||
#define BOOST_DETAIL_WIN_FILE_MANAGEMENT_HPP
|
#define BOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
#include <boost/detail/win/security.hpp>
|
#include <boost/detail/winapi/security.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
namespace win32
|
namespace winapi
|
||||||
{
|
{
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
using ::CreateFileA;
|
using ::CreateFileA;
|
||||||
@ -123,4 +127,4 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_WIN_THREAD_HPP
|
#endif // BOOST_DETAIL_WINAPI_THREAD_HPP
|
@ -6,17 +6,20 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_HANDLES_HPP
|
#ifndef BOOST_DETAIL_WINAPI_HANDLES_HPP
|
||||||
#define BOOST_DETAIL_WIN_HANDLES_HPP
|
#define BOOST_DETAIL_WINAPI_HANDLES_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
namespace win32
|
namespace winapi
|
||||||
{
|
{
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
using ::CloseHandle;
|
using ::CloseHandle;
|
||||||
@ -34,4 +37,4 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_WIN_HANDLES_HPP
|
#endif // BOOST_DETAIL_WINAPI_HANDLES_HPP
|
@ -6,19 +6,22 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_MEMORY_HPP
|
#ifndef BOOST_DETAIL_WINAPI_MEMORY_HPP
|
||||||
#define BOOST_DETAIL_WIN_MEMORY_HPP
|
#define BOOST_DETAIL_WINAPI_MEMORY_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
#include <boost/detail/win/security.hpp>
|
#include <boost/detail/winapi/security.hpp>
|
||||||
#include <boost/detail/win/LocalFree.hpp>
|
#include <boost/detail/winapi/LocalFree.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
namespace win32
|
namespace winapi
|
||||||
{
|
{
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
using ::CreateFileMappingA;
|
using ::CreateFileMappingA;
|
||||||
@ -30,9 +33,7 @@ namespace win32
|
|||||||
using ::OpenFileMappingA;
|
using ::OpenFileMappingA;
|
||||||
using ::UnmapViewOfFile;
|
using ::UnmapViewOfFile;
|
||||||
#else
|
#else
|
||||||
# ifdef HeapAlloc
|
#undef HeapAlloc
|
||||||
# undef HeapAlloc
|
|
||||||
# endif
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
__declspec(dllimport) void * __stdcall
|
__declspec(dllimport) void * __stdcall
|
||||||
CreateFileMappingA (void *, SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, unsigned long, const char *);
|
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
|
@ -6,15 +6,19 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_PROCESS_HPP
|
#ifndef BOOST_DETAIL_WINAPI_PROCESS_HPP
|
||||||
#define BOOST_DETAIL_WIN_PROCESS_HPP
|
#define BOOST_DETAIL_WINAPI_PROCESS_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
#include <boost/detail/win/GetCurrentProcess.hpp>
|
#include <boost/detail/winapi/GetCurrentProcess.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace win32 {
|
namespace winapi {
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
using ::GetCurrentProcessId;
|
using ::GetCurrentProcessId;
|
||||||
#else
|
#else
|
||||||
@ -30,4 +34,4 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // BOOST_DETAIL_WIN_PROCESS_HPP
|
#endif // BOOST_DETAIL_WINAPI_PROCESS_HPP
|
@ -6,17 +6,20 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_SECURITY_HPP
|
#ifndef BOOST_DETAIL_WINAPI_SECURITY_HPP
|
||||||
#define BOOST_DETAIL_WIN_SECURITY_HPP
|
#define BOOST_DETAIL_WINAPI_SECURITY_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
namespace win32
|
namespace winapi
|
||||||
{
|
{
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
typedef ::SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES_;
|
typedef ::SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES_;
|
||||||
@ -59,4 +62,4 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_WIN_SECURITY_HPP
|
#endif // BOOST_DETAIL_WINAPI_SECURITY_HPP
|
@ -6,17 +6,20 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP
|
#ifndef BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP
|
||||||
#define BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP
|
#define BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
namespace win32
|
namespace winapi
|
||||||
{
|
{
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
typedef ::CRITICAL_SECTION CRITICAL_SECTION_;
|
typedef ::CRITICAL_SECTION CRITICAL_SECTION_;
|
||||||
@ -27,7 +30,7 @@ namespace win32
|
|||||||
using ::TryEnterCriticalSection;
|
using ::TryEnterCriticalSection;
|
||||||
using ::LeaveCriticalSection;
|
using ::LeaveCriticalSection;
|
||||||
using ::DeleteCriticalSection;
|
using ::DeleteCriticalSection;
|
||||||
|
|
||||||
# ifdef BOOST_NO_ANSI_APIS
|
# ifdef BOOST_NO_ANSI_APIS
|
||||||
using ::CreateMutexW;
|
using ::CreateMutexW;
|
||||||
using ::CreateEventW;
|
using ::CreateEventW;
|
||||||
@ -45,9 +48,18 @@ namespace win32
|
|||||||
using ::ResetEvent;
|
using ::ResetEvent;
|
||||||
using ::WaitForMultipleObjects;
|
using ::WaitForMultipleObjects;
|
||||||
using ::WaitForSingleObject;
|
using ::WaitForSingleObject;
|
||||||
using ::QueueUserAPC;
|
using ::QueueUserAPC;
|
||||||
#else
|
|
||||||
|
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 )
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
struct CRITICAL_SECTION_
|
struct CRITICAL_SECTION_
|
||||||
{
|
{
|
||||||
struct critical_section_debug * DebugInfo;
|
struct critical_section_debug * DebugInfo;
|
||||||
@ -62,64 +74,73 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
__declspec(dllimport) void __stdcall
|
__declspec(dllimport) void __stdcall
|
||||||
InitializeCriticalSection(CRITICAL_SECTION_ *);
|
InitializeCriticalSection(CRITICAL_SECTION_ *);
|
||||||
__declspec(dllimport) void __stdcall
|
__declspec(dllimport) void __stdcall
|
||||||
EnterCriticalSection(CRITICAL_SECTION_ *);
|
EnterCriticalSection(CRITICAL_SECTION_ *);
|
||||||
__declspec(dllimport) bool __stdcall
|
__declspec(dllimport) bool __stdcall
|
||||||
TryEnterCriticalSection(CRITICAL_SECTION_ *);
|
TryEnterCriticalSection(CRITICAL_SECTION_ *);
|
||||||
__declspec(dllimport) void __stdcall
|
__declspec(dllimport) void __stdcall
|
||||||
LeaveCriticalSection(CRITICAL_SECTION_ *);
|
LeaveCriticalSection(CRITICAL_SECTION_ *);
|
||||||
__declspec(dllimport) void __stdcall
|
__declspec(dllimport) void __stdcall
|
||||||
DeleteCriticalSection(CRITICAL_SECTION_ *);
|
DeleteCriticalSection(CRITICAL_SECTION_ *);
|
||||||
|
|
||||||
struct _SECURITY_ATTRIBUTES;
|
struct _SECURITY_ATTRIBUTES;
|
||||||
# ifdef BOOST_NO_ANSI_APIS
|
# ifdef BOOST_NO_ANSI_APIS
|
||||||
__declspec(dllimport) void* __stdcall
|
__declspec(dllimport) void* __stdcall
|
||||||
CreateMutexW(_SECURITY_ATTRIBUTES*,int,wchar_t const*);
|
CreateMutexW(_SECURITY_ATTRIBUTES*,int,wchar_t const*);
|
||||||
__declspec(dllimport) void* __stdcall
|
__declspec(dllimport) void* __stdcall
|
||||||
CreateSemaphoreW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*);
|
CreateSemaphoreW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*);
|
||||||
__declspec(dllimport) void* __stdcall
|
__declspec(dllimport) void* __stdcall
|
||||||
CreateEventW(_SECURITY_ATTRIBUTES*,int,int,wchar_t const*);
|
CreateEventW(_SECURITY_ATTRIBUTES*,int,int,wchar_t const*);
|
||||||
__declspec(dllimport) void* __stdcall
|
__declspec(dllimport) void* __stdcall
|
||||||
OpenEventW(unsigned long,int,wchar_t const*);
|
OpenEventW(unsigned long,int,wchar_t const*);
|
||||||
# else
|
# else
|
||||||
__declspec(dllimport) void* __stdcall
|
__declspec(dllimport) void* __stdcall
|
||||||
CreateMutexA(_SECURITY_ATTRIBUTES*,int,char const*);
|
CreateMutexA(_SECURITY_ATTRIBUTES*,int,char const*);
|
||||||
__declspec(dllimport) void* __stdcall
|
__declspec(dllimport) void* __stdcall
|
||||||
CreateSemaphoreA(_SECURITY_ATTRIBUTES*,long,long,char const*);
|
CreateSemaphoreA(_SECURITY_ATTRIBUTES*,long,long,char const*);
|
||||||
__declspec(dllimport) void* __stdcall
|
__declspec(dllimport) void* __stdcall
|
||||||
CreateEventA(_SECURITY_ATTRIBUTES*,int,int,char const*);
|
CreateEventA(_SECURITY_ATTRIBUTES*,int,int,char const*);
|
||||||
__declspec(dllimport) void* __stdcall
|
__declspec(dllimport) void* __stdcall
|
||||||
OpenEventA(unsigned long,int,char const*);
|
OpenEventA(unsigned long,int,char const*);
|
||||||
# endif
|
# endif
|
||||||
__declspec(dllimport) int __stdcall
|
__declspec(dllimport) int __stdcall
|
||||||
ReleaseMutex(void*);
|
ReleaseMutex(void*);
|
||||||
__declspec(dllimport) unsigned long __stdcall
|
__declspec(dllimport) unsigned long __stdcall
|
||||||
WaitForSingleObject(void*,unsigned long);
|
WaitForSingleObject(void*,unsigned long);
|
||||||
__declspec(dllimport) unsigned long __stdcall
|
__declspec(dllimport) unsigned long __stdcall
|
||||||
WaitForMultipleObjects(unsigned long nCount,
|
WaitForMultipleObjects(unsigned long nCount,
|
||||||
void* const * lpHandles,
|
void* const * lpHandles,
|
||||||
int bWaitAll,
|
int bWaitAll,
|
||||||
unsigned long dwMilliseconds);
|
unsigned long dwMilliseconds);
|
||||||
__declspec(dllimport) int __stdcall
|
__declspec(dllimport) int __stdcall
|
||||||
ReleaseSemaphore(void*,long,long*);
|
ReleaseSemaphore(void*,long,long*);
|
||||||
typedef void (__stdcall *PAPCFUNC8)(ulong_ptr);
|
typedef void (__stdcall *PAPCFUNC8)(ULONG_PTR_);
|
||||||
__declspec(dllimport) unsigned long __stdcall
|
__declspec(dllimport) unsigned long __stdcall
|
||||||
QueueUserAPC(PAPCFUNC8,void*,ulong_ptr);
|
QueueUserAPC(PAPCFUNC8,void*,ULONG_PTR_);
|
||||||
# ifndef UNDER_CE
|
# ifndef UNDER_CE
|
||||||
__declspec(dllimport) int __stdcall
|
__declspec(dllimport) int __stdcall
|
||||||
SetEvent(void*);
|
SetEvent(void*);
|
||||||
__declspec(dllimport) int __stdcall
|
__declspec(dllimport) int __stdcall
|
||||||
ResetEvent(void*);
|
ResetEvent(void*);
|
||||||
# else
|
# else
|
||||||
using ::SetEvent;
|
using ::SetEvent;
|
||||||
using ::ResetEvent;
|
using ::ResetEvent;
|
||||||
# endif
|
# 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
|
@ -6,19 +6,21 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_SYSTEM_HPP
|
#ifndef BOOST_DETAIL_WINAPI_SYSTEM_HPP
|
||||||
#define BOOST_DETAIL_WIN_SYSTEM_HPP
|
#define BOOST_DETAIL_WINAPI_SYSTEM_HPP
|
||||||
#include <boost/config.hpp>
|
|
||||||
#include <cstdarg>
|
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
extern "C" __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *);
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace win32 {
|
namespace winapi {
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
typedef ::SYSTEM_INFO SYSTEM_INFO_;
|
typedef ::SYSTEM_INFO SYSTEM_INFO_;
|
||||||
|
extern "C" __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *);
|
||||||
#else
|
#else
|
||||||
extern "C" {
|
extern "C" {
|
||||||
typedef struct _SYSTEM_INFO {
|
typedef struct _SYSTEM_INFO {
|
||||||
@ -47,4 +49,4 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
#endif // BOOST_DETAIL_WINAPI_SYSTEM_HPP
|
@ -6,17 +6,21 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_THREAD_HPP
|
#ifndef BOOST_DETAIL_WINAPI_THREAD_HPP
|
||||||
#define BOOST_DETAIL_WIN_THREAD_HPP
|
#define BOOST_DETAIL_WINAPI_THREAD_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
#include <boost/detail/win/GetCurrentThread.hpp>
|
#include <boost/detail/winapi/GetCurrentThread.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
namespace win32
|
namespace winapi
|
||||||
{
|
{
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
using ::GetCurrentThreadId;
|
using ::GetCurrentThreadId;
|
||||||
@ -42,4 +46,4 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_WIN_THREAD_HPP
|
#endif // BOOST_DETAIL_WINAPI_THREAD_HPP
|
@ -6,15 +6,18 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_TIME_HPP
|
#ifndef BOOST_DETAIL_WINAPI_TIME_HPP
|
||||||
#define BOOST_DETAIL_WIN_TIME_HPP
|
#define BOOST_DETAIL_WINAPI_TIME_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace win32 {
|
namespace winapi {
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
typedef FILETIME FILETIME_;
|
typedef FILETIME FILETIME_;
|
||||||
typedef PFILETIME PFILETIME_;
|
typedef PFILETIME PFILETIME_;
|
||||||
@ -23,9 +26,9 @@ namespace win32 {
|
|||||||
typedef SYSTEMTIME SYSTEMTIME_;
|
typedef SYSTEMTIME SYSTEMTIME_;
|
||||||
typedef SYSTEMTIME* PSYSTEMTIME_;
|
typedef SYSTEMTIME* PSYSTEMTIME_;
|
||||||
|
|
||||||
#ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime
|
#ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime
|
||||||
using ::GetSystemTimeAsFileTime;
|
using ::GetSystemTimeAsFileTime;
|
||||||
#endif
|
#endif
|
||||||
using ::FileTimeToLocalFileTime;
|
using ::FileTimeToLocalFileTime;
|
||||||
using ::GetSystemTime;
|
using ::GetSystemTime;
|
||||||
using ::SystemTimeToFileTime;
|
using ::SystemTimeToFileTime;
|
||||||
@ -49,24 +52,34 @@ extern "C" {
|
|||||||
WORD_ wMilliseconds;
|
WORD_ wMilliseconds;
|
||||||
} SYSTEMTIME_, *PSYSTEMTIME_;
|
} 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
|
__declspec(dllimport) void WINAPI
|
||||||
GetSystemTimeAsFileTime(FILETIME_* lpFileTime);
|
GetSystemTimeAsFileTime(FILETIME_* lpFileTime);
|
||||||
#endif
|
#endif
|
||||||
__declspec(dllimport) int WINAPI
|
__declspec(dllimport) int WINAPI
|
||||||
FileTimeToLocalFileTime(const FILETIME_* lpFileTime,
|
FileTimeToLocalFileTime(const FILETIME_* lpFileTime,
|
||||||
FILETIME_* lpLocalFileTime);
|
FILETIME_* lpLocalFileTime);
|
||||||
__declspec(dllimport) void WINAPI
|
__declspec(dllimport) void WINAPI
|
||||||
GetSystemTime(SYSTEMTIME_* lpSystemTime);
|
GetSystemTime(SYSTEMTIME_* lpSystemTime);
|
||||||
__declspec(dllimport) int WINAPI
|
__declspec(dllimport) int WINAPI
|
||||||
SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime,
|
SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime,
|
||||||
FILETIME_* lpFileTime);
|
FILETIME_* lpFileTime);
|
||||||
__declspec(dllimport) unsigned long __stdcall
|
__declspec(dllimport) DWORD_ WINAPI
|
||||||
GetTickCount();
|
GetTickCount();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef BOOST_HAS_GETSYSTEMTIMEASFILETIME
|
||||||
|
inline void WINAPI GetSystemTimeAsFileTime(FILETIME_* lpFileTime)
|
||||||
|
{
|
||||||
|
SYSTEMTIME_ st;
|
||||||
|
GetSystemTime(&st);
|
||||||
|
SystemTimeToFileTime(&st, lpFileTime);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
#endif // BOOST_DETAIL_WINAPI_TIME_HPP
|
@ -6,17 +6,20 @@
|
|||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_WIN_TIMERS_HPP
|
#ifndef BOOST_DETAIL_WINAPI_TIMERS_HPP
|
||||||
#define BOOST_DETAIL_WIN_TIMERS_HPP
|
#define BOOST_DETAIL_WINAPI_TIMERS_HPP
|
||||||
|
|
||||||
#include <boost/detail/win/basic_types.hpp>
|
#include <boost/detail/winapi/basic_types.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
namespace win32
|
namespace winapi
|
||||||
{
|
{
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
using ::QueryPerformanceCounter;
|
using ::QueryPerformanceCounter;
|
||||||
@ -38,4 +41,4 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_WIN_TIMERS_HPP
|
#endif // BOOST_DETAIL_WINAPI_TIMERS_HPP
|
@ -3,7 +3,7 @@
|
|||||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#include <boost/functional/detail/container_fwd.hpp>
|
#include <boost/detail/container_fwd.hpp>
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(__GNUC__, < 3) && \
|
#if BOOST_WORKAROUND(__GNUC__, < 3) && \
|
||||||
!defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
|
!defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
|
||||||
|
Reference in New Issue
Block a user