forked from boostorg/detail
Compare commits
1 Commits
svn-branch
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
93c00d1c0f |
@ -1,47 +0,0 @@
|
||||
// boost/detail/bitmask.hpp ------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2006
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// Usage: enum foo { a=1, b=2, c=4 };
|
||||
// BOOST_BITMASK( foo );
|
||||
//
|
||||
// void f( foo arg );
|
||||
// ...
|
||||
// f( a | c );
|
||||
|
||||
#ifndef BOOST_BITMASK_HPP
|
||||
#define BOOST_BITMASK_HPP
|
||||
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#define BOOST_BITMASK(Bitmask) \
|
||||
\
|
||||
inline Bitmask operator| (Bitmask x , Bitmask y ) \
|
||||
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
|
||||
| static_cast<boost::int_least32_t>(y)); } \
|
||||
\
|
||||
inline Bitmask operator& (Bitmask x , Bitmask y ) \
|
||||
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
|
||||
& static_cast<boost::int_least32_t>(y)); } \
|
||||
\
|
||||
inline Bitmask operator^ (Bitmask x , Bitmask y ) \
|
||||
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
|
||||
^ static_cast<boost::int_least32_t>(y)); } \
|
||||
\
|
||||
inline Bitmask operator~ (Bitmask x ) \
|
||||
{ return static_cast<Bitmask>(~static_cast<boost::int_least32_t>(x)); } \
|
||||
\
|
||||
inline Bitmask & operator&=(Bitmask & x , Bitmask y) \
|
||||
{ x = x & y ; return x ; } \
|
||||
\
|
||||
inline Bitmask & operator|=(Bitmask & x , Bitmask y) \
|
||||
{ x = x | y ; return x ; } \
|
||||
\
|
||||
inline Bitmask & operator^=(Bitmask & x , Bitmask y) \
|
||||
{ x = x ^ y ; return x ; }
|
||||
|
||||
#endif // BOOST_BITMASK_HPP
|
||||
|
@ -1,92 +1,24 @@
|
||||
|
||||
// Copyright 2005-2011 Daniel James.
|
||||
// Copyright 2005-2008 Daniel James.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Note: if you change this include guard, you also need to change
|
||||
// container_fwd_compile_fail.cpp
|
||||
#if !defined(BOOST_DETAIL_CONTAINER_FWD_HPP)
|
||||
#define BOOST_DETAIL_CONTAINER_FWD_HPP
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020) && \
|
||||
!defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// 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(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__)
|
||||
// Comeau STL:
|
||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||
# elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
|
||||
// Rogue Wave library:
|
||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||
# elif defined(_LIBCPP_VERSION)
|
||||
// libc++
|
||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||
# elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
|
||||
// GNU libstdc++ 3
|
||||
//
|
||||
// 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
|
||||
# else
|
||||
# if defined(__GLIBCXX__) && __GLIBCXX__ >= 20040530
|
||||
# define BOOST_CONTAINER_FWD_COMPLEX_STRUCT
|
||||
# endif
|
||||
# endif
|
||||
# elif defined(__STL_CONFIG_H)
|
||||
// generic SGI STL
|
||||
//
|
||||
// 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)
|
||||
# define BOOST_CONTAINER_FWD_BAD_DEQUE
|
||||
# endif
|
||||
# elif defined(__MSL_CPP__)
|
||||
// MSL standard lib:
|
||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||
# elif defined(__IBMCPP__)
|
||||
// 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
|
||||
# elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
|
||||
// Dinkumware Library (this has to appear after any possible replacement
|
||||
// libraries)
|
||||
# else
|
||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
|
||||
|
||||
#if defined(BOOST_DETAIL_NO_CONTAINER_FWD) && \
|
||||
!defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD)
|
||||
#if defined(BOOST_DETAIL_NO_CONTAINER_FWD) \
|
||||
|| ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) \
|
||||
&& (defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL))) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, > 0x551) \
|
||||
|| BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \
|
||||
|| (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
|
||||
|
||||
#include <deque>
|
||||
#include <list>
|
||||
@ -101,6 +33,17 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && \
|
||||
defined(__STL_CONFIG_H)
|
||||
|
||||
#define BOOST_CONTAINER_FWD_BAD_BITSET
|
||||
|
||||
#if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG)
|
||||
#define BOOST_CONTAINER_FWD_BAD_DEQUE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
|
||||
#include <deque>
|
||||
#endif
|
||||
@ -120,18 +63,21 @@ namespace std
|
||||
template <class charT, class traits, class Allocator> class basic_string;
|
||||
|
||||
#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
|
||||
|
||||
template <class charT> struct string_char_traits;
|
||||
#else
|
||||
template <class charT> struct char_traits;
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_CONTAINER_FWD_COMPLEX_STRUCT)
|
||||
template <class T> struct complex;
|
||||
#else
|
||||
template <class T> class complex;
|
||||
#endif
|
||||
#if BOOST_CLANG
|
||||
template <class T> struct complex;
|
||||
#else
|
||||
template <class T> class complex;
|
||||
#endif
|
||||
}
|
||||
|
||||
// gcc 3.4 and greater
|
||||
namespace std
|
||||
{
|
||||
#if !defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
|
||||
template <class T, class Allocator> class deque;
|
||||
#endif
|
||||
@ -154,9 +100,6 @@ namespace std
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_DETAIL_NO_CONTAINER_FWD &&
|
||||
// !defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD)
|
||||
|
||||
#endif // BOOST_DETAIL_TEST_CONFIG_ONLY
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -16,10 +16,9 @@
|
||||
|
||||
/* If we're using clang + glibc, we have to get hacky.
|
||||
* See http://llvm.org/bugs/show_bug.cgi?id=6907 */
|
||||
#if defined(__clang__) && (__clang_major__ < 3) && \
|
||||
#if defined(__clang__) && \
|
||||
defined(__GNU_LIBRARY__) && /* up to version 5 */ \
|
||||
defined(__GLIBC__) && /* version 6 + */ \
|
||||
!defined(_FENV_H)
|
||||
defined(__GLIBC__) /* version 6 + */
|
||||
#define _FENV_H
|
||||
|
||||
#include <features.h>
|
||||
|
@ -54,11 +54,7 @@ extern "C" long __cdecl InterlockedExchangeAdd( long*, long );
|
||||
|
||||
#elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_MSVC >= 1600
|
||||
|
||||
#include <intrin.h>
|
||||
|
||||
#elif defined( __CLRCALL_PURE_OR_CDECL )
|
||||
#if 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 * );
|
||||
@ -110,28 +106,21 @@ extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* );
|
||||
|
||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
|
||||
|
||||
#if defined(__MINGW64__)
|
||||
#define BOOST_INTERLOCKED_IMPORT
|
||||
#else
|
||||
#define BOOST_INTERLOCKED_IMPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
|
||||
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" __declspec(dllimport) long __stdcall InterlockedIncrement( long volatile * );
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volatile * );
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long );
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volatile *, long );
|
||||
extern "C" __declspec(dllimport) 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" __declspec(dllimport) void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* );
|
||||
extern "C" __declspec(dllimport) void* __stdcall InterlockedExchangePointer( void* volatile *, void* );
|
||||
# endif
|
||||
|
||||
} // namespace detail
|
||||
|
@ -95,22 +95,6 @@ template<class T, class U> inline void test_eq_impl( char const * expr1, char co
|
||||
}
|
||||
}
|
||||
|
||||
template<class T, class U> inline void test_ne_impl( char const * expr1, char const * expr2,
|
||||
char const * file, int line, char const * function, T const & t, U const & u )
|
||||
{
|
||||
if( t != u )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): test '" << expr1 << " != " << expr2
|
||||
<< "' failed in function '" << function << "': "
|
||||
<< "'" << t << "' == '" << u << "'" << std::endl;
|
||||
++test_errors();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
inline int report_errors()
|
||||
@ -138,6 +122,5 @@ inline int report_errors()
|
||||
#define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, __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_NE(expr1,expr2) ( ::boost::detail::test_ne_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
|
||||
|
@ -92,8 +92,7 @@ namespace std {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) \
|
||||
&& !defined(_LIBCPP_VERSION)
|
||||
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__)
|
||||
#define BOOST_CODECVT_DO_LENGTH_CONST const
|
||||
#else
|
||||
#define BOOST_CODECVT_DO_LENGTH_CONST
|
||||
|
@ -14,19 +14,11 @@
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace win32 {
|
||||
#if defined( UNDER_CE )
|
||||
// Windows CE define GetCurrentThread as an inline function in kfuncs.h
|
||||
inline HANDLE_ GetCurrentThread()
|
||||
{
|
||||
return ::GetCurrentThread();
|
||||
}
|
||||
#else
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetCurrentThread;
|
||||
#else
|
||||
extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentThread();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace win32 {
|
||||
#if !defined(UNDER_CE) // Windows CE does not define GetProcessTimes
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetProcessTimes;
|
||||
#else
|
||||
@ -27,7 +26,6 @@ namespace win32 {
|
||||
LPFILETIME_ lpUserTime
|
||||
);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,9 +23,7 @@ namespace win32 {
|
||||
typedef SYSTEMTIME SYSTEMTIME_;
|
||||
typedef SYSTEMTIME* PSYSTEMTIME_;
|
||||
|
||||
#ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime
|
||||
using ::GetSystemTimeAsFileTime;
|
||||
#endif
|
||||
using ::FileTimeToLocalFileTime;
|
||||
using ::GetSystemTime;
|
||||
using ::SystemTimeToFileTime;
|
||||
@ -49,10 +47,8 @@ extern "C" {
|
||||
WORD_ wMilliseconds;
|
||||
} SYSTEMTIME_, *PSYSTEMTIME_;
|
||||
|
||||
#ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime
|
||||
__declspec(dllimport) void WINAPI
|
||||
GetSystemTimeAsFileTime(FILETIME_* lpFileTime);
|
||||
#endif
|
||||
__declspec(dllimport) int WINAPI
|
||||
FileTimeToLocalFileTime(const FILETIME_* lpFileTime,
|
||||
FILETIME_* lpLocalFileTime);
|
||||
|
@ -5,8 +5,6 @@
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
################################################################################
|
||||
|
||||
build-project container_fwd ;
|
||||
|
||||
project detail/test
|
||||
: requirements
|
||||
<toolset>clang:<cxxflags>-Wno-unused
|
||||
|
@ -1,29 +0,0 @@
|
||||
|
||||
# Copyright 2011 Daniel James.
|
||||
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import testing ;
|
||||
|
||||
project detail/test/container_fwd
|
||||
: requirements
|
||||
<warnings>all
|
||||
<toolset>intel:<warnings>on
|
||||
<toolset>gcc:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
|
||||
<toolset>darwin:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
|
||||
<toolset>clang:<cxxflags>"-pedantic -Wextra -Wmismatched-tags"
|
||||
<warnings-as-errors>on
|
||||
;
|
||||
|
||||
run container_no_fwd_test.cpp ;
|
||||
run container_fwd_test.cpp : : : : container_fwd ;
|
||||
run container_fwd_test.cpp : :
|
||||
: <define>_STLP_DEBUG <define>_GLIBCXX_DEBUG
|
||||
: container_fwd_debug ;
|
||||
|
||||
compile-fail correctly_disable_fail.cpp
|
||||
: <warnings-as-errors>off
|
||||
: correctly_disable ;
|
||||
compile-fail correctly_disable_fail.cpp
|
||||
: <warnings-as-errors>off <define>_STLP_DEBUG <define>_GLIBCXX_DEBUG
|
||||
: correctly_disable_debug ;
|
@ -1,43 +0,0 @@
|
||||
|
||||
// Copyright 2011 Daniel James.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// This tests if container forwarding is correctly disabled. If it isn't
|
||||
// disabled it causes a compile error (which causes the test to pass).
|
||||
// If it is disabled it tries container forwarding. If it doesn't work
|
||||
// then there will be a compile error, indicating that it is correctly
|
||||
// disabled. But if there isn't a compile error that indicates that
|
||||
// container forwarding might work.
|
||||
//
|
||||
// Since this test only tries std::vector, it might get it wrong but I didn't
|
||||
// want it to fail because of some incompatibility with a trickier class.
|
||||
|
||||
#define BOOST_DETAIL_TEST_CONFIG_ONLY
|
||||
#include <boost/detail/container_fwd.hpp>
|
||||
|
||||
#if !defined(BOOST_DETAIL_NO_CONTAINER_FWD)
|
||||
#error "Failing in order to pass test"
|
||||
#else
|
||||
#define BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD
|
||||
|
||||
#undef BOOST_DETAIL_CONTAINER_FWD_HPP
|
||||
#undef BOOST_DETAIL_TEST_CONFIG_ONLY
|
||||
|
||||
#include <boost/detail/container_fwd.hpp>
|
||||
|
||||
template <class T, class Allocator>
|
||||
void test(std::vector<T, Allocator> const&)
|
||||
{
|
||||
}
|
||||
|
||||
#include <vector>
|
||||
|
||||
int main ()
|
||||
{
|
||||
std::vector<int> x;
|
||||
test(x);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user