3rd-party libraries upgraded (Windows only)

This commit is contained in:
pschaefer 2014-01-10 21:53:19 +00:00
parent 6fad7e8bf6
commit faaac93f81
1313 changed files with 223669 additions and 200265 deletions

View File

@ -73,7 +73,7 @@ public:
unsigned m_nError; unsigned m_nError;
CSimpleException(const int nError) : CSimpleException(const int nError) :
m_nError(nError) { }; m_nError(nError) { }
const std::string& what() const; const std::string& what() const;
@ -89,6 +89,7 @@ protected:
FILE *m_hFile; FILE *m_hFile;
int m_nFileNo; int m_nFileNo;
boost::filesystem::path m_strPath; boost::filesystem::path m_strPath;
std::string m_strNativePath;
public: public:
enum seek_offset { enum seek_offset {
@ -96,15 +97,18 @@ public:
sk_current sk_current
}; };
CFile() : m_hFile(NULL), m_nFileNo(0) { /* sonst nix */ }; CFile() : m_hFile(NULL), m_nFileNo(0) { /* sonst nix */ }
CFile(const std::string& strPath); CFile(const std::string& strPath);
// throw CSimpleException // throw CSimpleException
virtual ~CFile(); virtual ~CFile();
FILE *GetFP() { return m_hFile; }; FILE *GetFP() { return m_hFile; }
int GetFN() { return m_nFileNo; }; int GetFN() { return m_nFileNo; }
const char *GetFileName() { return m_strPath.string().c_str(); }; const char *GetFileName() {
m_strNativePath = m_strPath.string();
return m_strNativePath.c_str();
}
sff_byte GetC(); sff_byte GetC();
sff_dword Tell(); sff_dword Tell();
bool Eof(); bool Eof();

View File

@ -293,11 +293,11 @@ int main( int argc, char *argv[] )
} }
} }
catch (const std::exception & e) { catch (const std::exception& e) {
cerr << "ERROR: " << pathInFileName.string() << ": " << e.what() << endl; cerr << "ERROR: " << pathInFileName.string() << ": " << e.what() << endl;
rc = 2; rc = 2;
} }
catch (CSimpleException e) { catch (const CSimpleException& e) {
cerr << "ERROR: " << pathInFileName.string() << ": " << e.what() << endl; cerr << "ERROR: " << pathInFileName.string() << ": " << e.what() << endl;
rc = 2; rc = 2;
} }
@ -311,7 +311,7 @@ int main( int argc, char *argv[] )
} }
if (!bQuiet) cout << "Finished. " << endl << endl; if (!bQuiet) cout << "Finished. " << endl << endl;
} }
catch (const std::exception & e) { catch (const std::exception& e) {
cerr << "ERROR: " << e.what() << endl; cerr << "ERROR: " << e.what() << endl;
rc = 2; rc = 2;
} }

View File

@ -22,19 +22,23 @@ LDFLAGS= $(ldebug) $(conlflags)
LDLIBS= $(conlibs) $(LIBJPEG) $(LIBTIFF) LDLIBS= $(conlibs) $(LIBJPEG) $(LIBTIFF)
OBJ = \ OBJ = \
..\src\cmdline.obj \ ..\src\cmdline.obj \
..\src\codes.obj \ ..\src\codes.obj \
..\src\common.obj \ ..\src\common.obj \
..\src\decoder.obj \ ..\src\decoder.obj \
..\src\input.obj \ ..\src\input.obj \
..\src\main.obj \ ..\src\main.obj \
..\src\my_getopt.obj \ ..\src\my_getopt.obj \
..\src\output.obj \ ..\src\output.obj \
boost\libs\system\src\error_code.obj \ boost\libs\system\src\error_code.obj \
boost\libs\filesystem\src\operations.obj \ boost\libs\filesystem\src\operations.obj \
boost\libs\filesystem\src\path.obj \ boost\libs\filesystem\src\path.obj \
boost\libs\filesystem\src\portability.obj \ boost\libs\filesystem\src\portability.obj \
boost\libs\filesystem\src\utf8_codecvt_facet.obj boost\libs\filesystem\src\utf8_codecvt_facet.obj \
boost\libs\filesystem\src\codecvt_error_category.obj \
boost\libs\filesystem\src\path_traits.obj \
boost\libs\filesystem\src\unique_path.obj \
boost\libs\filesystem\src\windows_file_codecvt.obj
# Template command for compiling .c to .obj # Template command for compiling .c to .obj
.c.obj: .c.obj:

View File

@ -1,8 +1,11 @@
// //
// boost/assert.hpp - BOOST_ASSERT(expr) // boost/assert.hpp - BOOST_ASSERT(expr)
// BOOST_ASSERT_MSG(expr, msg)
// BOOST_VERIFY(expr)
// //
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2007 Peter Dimov // Copyright (c) 2007 Peter Dimov
// Copyright (c) Beman Dawes 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at // accompanying file LICENSE_1_0.txt or copy at
@ -13,6 +16,16 @@
// See http://www.boost.org/libs/utility/assert.html for documentation. // See http://www.boost.org/libs/utility/assert.html for documentation.
// //
//
// Stop inspect complaining about use of 'assert':
//
// boostinspect:naassert_macro
//
//--------------------------------------------------------------------------------------//
// BOOST_ASSERT //
//--------------------------------------------------------------------------------------//
#undef BOOST_ASSERT #undef BOOST_ASSERT
#if defined(BOOST_DISABLE_ASSERTS) #if defined(BOOST_DISABLE_ASSERTS)
@ -25,18 +38,86 @@
namespace boost namespace boost
{ {
void assertion_failed(char const * expr,
void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined char const * function, char const * file, long line); // user defined
} // namespace boost } // namespace boost
#define BOOST_ASSERT(expr) ((expr)? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) #define BOOST_ASSERT(expr) ((expr) \
? ((void)0) \
: ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
#else #else
# include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same # include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same
# define BOOST_ASSERT(expr) assert(expr) # define BOOST_ASSERT(expr) assert(expr)
#endif #endif
//--------------------------------------------------------------------------------------//
// BOOST_ASSERT_MSG //
//--------------------------------------------------------------------------------------//
# undef BOOST_ASSERT_MSG
#if defined(BOOST_DISABLE_ASSERTS) || defined(NDEBUG)
#define BOOST_ASSERT_MSG(expr, msg) ((void)0)
#elif defined(BOOST_ENABLE_ASSERT_HANDLER)
#include <boost/current_function.hpp>
namespace boost
{
void assertion_failed_msg(char const * expr, char const * msg,
char const * function, char const * file, long line); // user defined
} // namespace boost
#define BOOST_ASSERT_MSG(expr, msg) ((expr) \
? ((void)0) \
: ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
#else
#ifndef BOOST_ASSERT_HPP
#define BOOST_ASSERT_HPP
#include <cstdlib>
#include <iostream>
#include <boost/current_function.hpp>
// IDE's like Visual Studio perform better if output goes to std::cout or
// some other stream, so allow user to configure output stream:
#ifndef BOOST_ASSERT_MSG_OSTREAM
# define BOOST_ASSERT_MSG_OSTREAM std::cerr
#endif
namespace boost
{
namespace assertion
{
namespace detail
{
inline void assertion_failed_msg(char const * expr, char const * msg, char const * function,
char const * file, long line)
{
BOOST_ASSERT_MSG_OSTREAM
<< "***** Internal Program Error - assertion (" << expr << ") failed in "
<< function << ":\n"
<< file << '(' << line << "): " << msg << std::endl;
std::abort();
}
} // detail
} // assertion
} // detail
#endif
#define BOOST_ASSERT_MSG(expr, msg) ((expr) \
? ((void)0) \
: ::boost::assertion::detail::assertion_failed_msg(#expr, msg, \
BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
#endif
//--------------------------------------------------------------------------------------//
// BOOST_VERIFY //
//--------------------------------------------------------------------------------------//
#undef BOOST_VERIFY #undef BOOST_VERIFY
#if defined(BOOST_DISABLE_ASSERTS) || ( !defined(BOOST_ENABLE_ASSERT_HANDLER) && defined(NDEBUG) ) #if defined(BOOST_DISABLE_ASSERTS) || ( !defined(BOOST_ENABLE_ASSERT_HANDLER) && defined(NDEBUG) )

View File

@ -36,7 +36,7 @@
#endif #endif
// if we don't have a std library config set, try and find one: // if we don't have a std library config set, try and find one:
#if !defined(BOOST_STDLIB_CONFIG) && !defined(BOOST_NO_STDLIB_CONFIG) && !defined(BOOST_NO_CONFIG) #if !defined(BOOST_STDLIB_CONFIG) && !defined(BOOST_NO_STDLIB_CONFIG) && !defined(BOOST_NO_CONFIG) && defined(__cplusplus)
# include <boost/config/select_stdlib_config.hpp> # include <boost/config/select_stdlib_config.hpp>
#endif #endif
// if we have a std library config, include it now: // if we have a std library config, include it now:

View File

@ -21,7 +21,7 @@
// 8026 - functions taking class by value arguments are not expanded inline // 8026 - functions taking class by value arguments are not expanded inline
#pragma nopushoptwarn #pragma nopushoptwarn
# pragma option push -Vx -Ve -a8 -b -pc -Vmv -VC- -Vl- -w-8027 -w-8026 # pragma option push -a8 -Vx- -Ve- -b- -pc -Vmv -VC- -Vl- -w-8027 -w-8026

View File

@ -25,6 +25,9 @@ BOOST_LIB_DIAGNOSTIC: Optional: when set the header will print out the name
of the library selected (useful for debugging). of the library selected (useful for debugging).
BOOST_AUTO_LINK_NOMANGLE: Specifies that we should link to BOOST_LIB_NAME.lib, BOOST_AUTO_LINK_NOMANGLE: Specifies that we should link to BOOST_LIB_NAME.lib,
rather than a mangled-name version. rather than a mangled-name version.
BOOST_AUTO_LINK_TAGGED: Specifies that we link to libraries built with the --layout=tagged option.
This is essentially the same as the default name-mangled version, but without
the compiler name and version, or the Boost version. Just the build options.
These macros will be undef'ed at the end of the header, further this header These macros will be undef'ed at the end of the header, further this header
has no include guards - so be sure to include it only once from your library! has no include guards - so be sure to include it only once from your library!
@ -60,6 +63,8 @@ BOOST_LIB_RT_OPT: A suffix that indicates the runtime library used,
a hiphen: a hiphen:
s static runtime (dynamic if not present). s static runtime (dynamic if not present).
g debug/diagnostic runtime (release if not present).
y Python debug/diagnostic runtime (release if not present).
d debug build (release if not present). d debug build (release if not present).
g debug/diagnostic runtime (release if not present). g debug/diagnostic runtime (release if not present).
p STLPort Build. p STLPort Build.
@ -140,11 +145,16 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
// vc90: // vc90:
# define BOOST_LIB_TOOLSET "vc90" # define BOOST_LIB_TOOLSET "vc90"
#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1600) #elif defined(BOOST_MSVC) && (BOOST_MSVC == 1600)
// vc10: // vc10:
# define BOOST_LIB_TOOLSET "vc100" # define BOOST_LIB_TOOLSET "vc100"
#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1700)
// vc11:
# define BOOST_LIB_TOOLSET "vc110"
#elif defined(__BORLANDC__) #elif defined(__BORLANDC__)
// CBuilder 6: // CBuilder 6:
@ -183,8 +193,16 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS)) # if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS))
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-gydp"
# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# define BOOST_LIB_RT_OPT "-gdp" # define BOOST_LIB_RT_OPT "-gdp"
# elif defined(_DEBUG)\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-gydp"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
# error "Build options aren't compatible with pre-built libraries"
# elif defined(_DEBUG) # elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-gdp" # define BOOST_LIB_RT_OPT "-gdp"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") # pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
@ -195,8 +213,16 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) # elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-gydpn"
# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# define BOOST_LIB_RT_OPT "-gdpn" # define BOOST_LIB_RT_OPT "-gdpn"
# elif defined(_DEBUG)\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-gydpn"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
# error "Build options aren't compatible with pre-built libraries"
# elif defined(_DEBUG) # elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-gdpn" # define BOOST_LIB_RT_OPT "-gdpn"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") # pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
@ -207,7 +233,9 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# else # else
# if defined(_DEBUG) # if defined(_DEBUG) && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-gyd"
# elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-gd" # define BOOST_LIB_RT_OPT "-gd"
# else # else
# define BOOST_LIB_RT_OPT # define BOOST_LIB_RT_OPT
@ -219,8 +247,16 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS)) # if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS))
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-sgydp"
# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# define BOOST_LIB_RT_OPT "-sgdp" # define BOOST_LIB_RT_OPT "-sgdp"
# elif defined(_DEBUG)\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-sgydp"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
# error "Build options aren't compatible with pre-built libraries"
# elif defined(_DEBUG) # elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-sgdp" # define BOOST_LIB_RT_OPT "-sgdp"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") # pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
@ -231,8 +267,16 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) # elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-sgydpn"
# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# define BOOST_LIB_RT_OPT "-sgdpn" # define BOOST_LIB_RT_OPT "-sgdpn"
# elif defined(_DEBUG)\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-sgydpn"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
# error "Build options aren't compatible with pre-built libraries"
# elif defined(_DEBUG) # elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-sgdpn" # define BOOST_LIB_RT_OPT "-sgdpn"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") # pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
@ -243,7 +287,10 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# else # else
# if defined(_DEBUG) # if defined(_DEBUG)\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-sgyd"
# elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-sgd" # define BOOST_LIB_RT_OPT "-sgd"
# else # else
# define BOOST_LIB_RT_OPT "-s" # define BOOST_LIB_RT_OPT "-s"
@ -270,16 +317,26 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# ifdef _RTLDLL # ifdef _RTLDLL
# ifdef BOOST_BORLAND_DEBUG # if defined(BOOST_BORLAND_DEBUG)\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-yd"
# elif defined(BOOST_BORLAND_DEBUG)
# define BOOST_LIB_RT_OPT "-d" # define BOOST_LIB_RT_OPT "-d"
# elif defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT -y
# else # else
# define BOOST_LIB_RT_OPT # define BOOST_LIB_RT_OPT
# endif # endif
# else # else
# ifdef BOOST_BORLAND_DEBUG # if defined(BOOST_BORLAND_DEBUG)\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-syd"
# elif defined(BOOST_BORLAND_DEBUG)
# define BOOST_LIB_RT_OPT "-sd" # define BOOST_LIB_RT_OPT "-sd"
# elif defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-sy"
# else # else
# define BOOST_LIB_RT_OPT "-s" # define BOOST_LIB_RT_OPT "-s"
# endif # endif
@ -309,16 +366,21 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
&& defined(BOOST_LIB_RT_OPT) \ && defined(BOOST_LIB_RT_OPT) \
&& defined(BOOST_LIB_VERSION) && defined(BOOST_LIB_VERSION)
#ifndef BOOST_AUTO_LINK_NOMANGLE #ifdef BOOST_AUTO_LINK_TAGGED
# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib") # pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib")
# ifdef BOOST_LIB_DIAGNOSTIC # ifdef BOOST_LIB_DIAGNOSTIC
# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib") # pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib")
# endif # endif
#else #elif defined(BOOST_AUTO_LINK_NOMANGLE)
# pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") # pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
# ifdef BOOST_LIB_DIAGNOSTIC # ifdef BOOST_LIB_DIAGNOSTIC
# pragma message ("Linking to lib file: " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") # pragma message ("Linking to lib file: " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
# endif # endif
#else
# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
# ifdef BOOST_LIB_DIAGNOSTIC
# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
# endif
#endif #endif
#else #else
@ -357,17 +419,4 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
#if defined(BOOST_DYN_LINK) #if defined(BOOST_DYN_LINK)
# undef BOOST_DYN_LINK # undef BOOST_DYN_LINK
#endif #endif
#if defined(BOOST_AUTO_LINK_NOMANGLE)
# undef BOOST_AUTO_LINK_NOMANGLE
#endif

View File

@ -17,7 +17,7 @@
#endif #endif
// last known compiler version: // last known compiler version:
#if (__BORLANDC__ > 0x610) #if (__BORLANDC__ > 0x613)
//# if defined(BOOST_ASSERT_CONFIG) //# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results" # error "Unknown compiler version - please run the configure tests and report the results"
//# else //# else
@ -46,6 +46,8 @@
// Borland C++Builder 5, command-line compiler 5.5: // Borland C++Builder 5, command-line compiler 5.5:
# define BOOST_NO_OPERATORS_IN_NAMESPACE # define BOOST_NO_OPERATORS_IN_NAMESPACE
# endif # endif
// Variadic macros do not exist for C++ Builder versions 5 and below
#define BOOST_NO_CXX11_VARIADIC_MACROS
# endif # endif
// Version 5.51 and below: // Version 5.51 and below:
@ -54,8 +56,13 @@
# define BOOST_NO_CV_VOID_SPECIALIZATIONS # define BOOST_NO_CV_VOID_SPECIALIZATIONS
# define BOOST_NO_DEDUCED_TYPENAME # define BOOST_NO_DEDUCED_TYPENAME
// workaround for missing WCHAR_MAX/WCHAR_MIN: // workaround for missing WCHAR_MAX/WCHAR_MIN:
#ifdef __cplusplus
#include <climits> #include <climits>
#include <cwchar> #include <cwchar>
#else
#include <limits.h>
#include <wchar.h>
#endif // __cplusplus
#ifndef WCHAR_MAX #ifndef WCHAR_MAX
# define WCHAR_MAX 0xffff # define WCHAR_MAX 0xffff
#endif #endif
@ -66,9 +73,8 @@
// Borland C++ Builder 6 and below: // Borland C++ Builder 6 and below:
#if (__BORLANDC__ <= 0x564) #if (__BORLANDC__ <= 0x564)
# define BOOST_NO_INTEGRAL_INT64_T
# ifdef NDEBUG # if defined(NDEBUG) && defined(__cplusplus)
// fix broken <cstring> so that Boost.test works: // fix broken <cstring> so that Boost.test works:
# include <cstring> # include <cstring>
# undef strcmp # undef strcmp
@ -107,28 +113,30 @@
# endif # endif
#endif #endif
// Borland C++ Builder 2007 December 2007 Update and below: #if (__BORLANDC__ <= 0x613) // Beman has asked Alisdair for more info
//#if (__BORLANDC__ <= 0x593)
#if (__BORLANDC__ <= 0x610) // Beman has asked Alisdair for more info
// we shouldn't really need this - but too many things choke // we shouldn't really need this - but too many things choke
// without it, this needs more investigation: // without it, this needs more investigation:
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
# define BOOST_NO_IS_ABSTRACT # define BOOST_NO_IS_ABSTRACT
# define BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS # define BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS
# define BOOST_NO_USING_TEMPLATE
# define BOOST_SP_NO_SP_CONVERTIBLE
// Temporary workaround // Temporary workaround
#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif #endif
// Borland C++ Builder 2008 and below: // Borland C++ Builder 2008 and below:
#if (__BORLANDC__ <= 0x601) # define BOOST_NO_INTEGRAL_INT64_T
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
# define BOOST_ILLEGAL_CV_REFERENCES
# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS # define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# define BOOST_NO_TWO_PHASE_NAME_LOOKUP # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
# define BOOST_NO_USING_TEMPLATE
# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
# define BOOST_NO_NESTED_FRIENDSHIP
# define BOOST_NO_TYPENAME_WITH_CTOR
#if (__BORLANDC__ < 0x600)
# define BOOST_ILLEGAL_CV_REFERENCES
#endif #endif
// //
@ -141,7 +149,16 @@
// //
// C++0x Macros: // C++0x Macros:
// //
#if defined( BOOST_CODEGEAR_0X_SUPPORT ) && (__BORLANDC__ >= 0x610) #if !defined( BOOST_CODEGEAR_0X_SUPPORT ) || (__BORLANDC__ < 0x610)
# define BOOST_NO_CXX11_CHAR16_T
# define BOOST_NO_CXX11_CHAR32_T
# define BOOST_NO_CXX11_DECLTYPE
# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
# define BOOST_NO_CXX11_EXTERN_TEMPLATE
# define BOOST_NO_CXX11_RVALUE_REFERENCES
# define BOOST_NO_CXX11_SCOPED_ENUMS
# define BOOST_NO_CXX11_STATIC_ASSERT
#else
# define BOOST_HAS_ALIGNOF # define BOOST_HAS_ALIGNOF
# define BOOST_HAS_CHAR16_T # define BOOST_HAS_CHAR16_T
# define BOOST_HAS_CHAR32_T # define BOOST_HAS_CHAR32_T
@ -150,35 +167,29 @@
# define BOOST_HAS_REF_QUALIFIER # define BOOST_HAS_REF_QUALIFIER
# define BOOST_HAS_RVALUE_REFS # define BOOST_HAS_RVALUE_REFS
# define BOOST_HAS_STATIC_ASSERT # define BOOST_HAS_STATIC_ASSERT
# define BOOST_NO_EXTERN_TEMPLATE
# define BOOST_NO_SCOPED_ENUMS
# define BOOST_NO_VARIADIC_TEMPLATES
# define BOOST_NO_CONSTEXPR
# define BOOST_NO_DEFAULTED_FUNCTIONS
# define BOOST_NO_DELETED_FUNCTIONS
# define BOOST_NO_RAW_LITERALS
# define BOOST_NO_UNICODE_LITERALS // UTF-8 still not supported
#else
# define BOOST_NO_CHAR16_T
# define BOOST_NO_CHAR32_T
# define BOOST_NO_DECLTYPE
# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
# define BOOST_NO_EXTERN_TEMPLATE
# define BOOST_NO_SCOPED_ENUMS
# define BOOST_NO_STATIC_ASSERT
# define BOOST_NO_RVALUE_REFERENCES
# define BOOST_NO_VARIADIC_TEMPLATES
# define BOOST_NO_CONSTEXPR
# define BOOST_NO_DEFAULTED_FUNCTIONS
# define BOOST_NO_DELETED_FUNCTIONS
# define BOOST_NO_RAW_LITERALS
# define BOOST_NO_UNICODE_LITERALS
#endif #endif
#define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_CXX11_AUTO_DECLARATIONS
#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#define BOOST_NO_INITIALIZER_LISTS #define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_NO_CXX11_DELETED_FUNCTIONS
#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#define BOOST_NO_CXX11_LAMBDAS
#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
#define BOOST_NO_CXX11_NULLPTR
#define BOOST_NO_CXX11_RANGE_BASED_FOR
#define BOOST_NO_CXX11_RAW_LITERALS
#define BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_CXX11_TEMPLATE_ALIASES
#define BOOST_NO_CXX11_UNICODE_LITERALS // UTF-8 still not supported
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#if __BORLANDC__ >= 0x590 #if __BORLANDC__ >= 0x590
# define BOOST_HAS_TR1_HASH # define BOOST_HAS_TR1_HASH
@ -218,7 +229,7 @@
// //
// check for exception handling support: // check for exception handling support:
// //
#if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS) #if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS # define BOOST_NO_EXCEPTIONS
#endif #endif
// //
@ -230,13 +241,14 @@
// //
// all versions support __declspec: // all versions support __declspec:
// //
#ifndef __STRICT_ANSI__ #if defined(__STRICT_ANSI__)
# define BOOST_HAS_DECLSPEC // config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
# define BOOST_SYMBOL_EXPORT
#endif #endif
// //
// ABI fixing headers: // ABI fixing headers:
// //
#if __BORLANDC__ < 0x600 // not implemented for version 6 compiler yet #if __BORLANDC__ != 0x600 // not implemented for version 6 compiler yet
#ifndef BOOST_ABI_PREFIX #ifndef BOOST_ABI_PREFIX
# define BOOST_ABI_PREFIX "boost/config/abi/borland_prefix.hpp" # define BOOST_ABI_PREFIX "boost/config/abi/borland_prefix.hpp"
#endif #endif
@ -261,7 +273,15 @@
# define BOOST_NO_VOID_RETURNS # define BOOST_NO_VOID_RETURNS
#endif #endif
// Borland did not implement value-initialization completely, as I reported
// in 2007, Borland Report 51854, "Value-initialization: POD struct should be
// zero-initialized", http://qc.embarcadero.com/wc/qcmain.aspx?d=51854
// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
// (Niels Dekker, LKEB, April 2010)
#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
#define BOOST_COMPILER "Borland C++ version " BOOST_STRINGIZE(__BORLANDC__) #define BOOST_COMPILER "Borland C++ version " BOOST_STRINGIZE(__BORLANDC__)

View File

@ -19,8 +19,8 @@
#endif #endif
// //
// versions check: // versions check:
// last known and checked version is 0x610 // last known and checked version is 0x621
#if (__CODEGEARC__ > 0x610) #if (__CODEGEARC__ > 0x621)
# if defined(BOOST_ASSERT_CONFIG) # if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results" # error "Unknown compiler version - please run the configure tests and report the results"
# else # else
@ -29,24 +29,38 @@
#endif #endif
// CodeGear C++ Builder 2009 // CodeGear C++ Builder 2009
#if (__CODEGEARC__ <= 0x610) #if (__CODEGEARC__ <= 0x613)
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL # define BOOST_NO_INTEGRAL_INT64_T
# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS # define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# define BOOST_NO_PRIVATE_IN_AGGREGATE # define BOOST_NO_PRIVATE_IN_AGGREGATE
# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
# define BOOST_NO_USING_TEMPLATE
// we shouldn't really need this - but too many things choke // we shouldn't really need this - but too many things choke
// without it, this needs more investigation: // without it, this needs more investigation:
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
# define BOOST_NO_TYPENAME_WITH_CTOR // Cannot use typename keyword when making temporaries of a dependant type # define BOOST_SP_NO_SP_CONVERTIBLE
# define BOOST_NO_NESTED_FRIENDSHIP // TC1 gives nested classes access rights as any other member #endif
// CodeGear C++ Builder 2010
#if (__CODEGEARC__ <= 0x621)
# define BOOST_NO_TYPENAME_WITH_CTOR // Cannot use typename keyword when making temporaries of a dependant type
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# define BOOST_NO_NESTED_FRIENDSHIP // TC1 gives nested classes access rights as any other member
# define BOOST_NO_USING_TEMPLATE
# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
// Temporary hack, until specific MPL preprocessed headers are generated // Temporary hack, until specific MPL preprocessed headers are generated
# define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS # define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
# ifdef NDEBUG // CodeGear has not yet completely implemented value-initialization, for
// example for array types, as I reported in 2010: Embarcadero Report 83751,
// "Value-initialization: arrays should have each element value-initialized",
// http://qc.embarcadero.com/wc/qcmain.aspx?d=83751
// Last checked version: Embarcadero C++ 6.21
// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
// (Niels Dekker, LKEB, April 2010)
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
# if defined(NDEBUG) && defined(__cplusplus)
// fix broken <cstring> so that Boost.test works: // fix broken <cstring> so that Boost.test works:
# include <cstring> # include <cstring>
# undef strcmp # undef strcmp
@ -58,10 +72,14 @@
# endif # endif
#endif #endif
// //
// C++0x macros: // C++0x macros:
// //
#if (__CODEGEARC__ <= 0x620)
#define BOOST_NO_CXX11_STATIC_ASSERT
#else
#define BOOST_HAS_STATIC_ASSERT
#endif
#define BOOST_HAS_CHAR16_T #define BOOST_HAS_CHAR16_T
#define BOOST_HAS_CHAR32_T #define BOOST_HAS_CHAR32_T
#define BOOST_HAS_LONG_LONG #define BOOST_HAS_LONG_LONG
@ -73,18 +91,25 @@
// #define BOOST_HAS_STATIC_ASSERT // #define BOOST_HAS_STATIC_ASSERT
#define BOOST_HAS_STD_TYPE_TRAITS #define BOOST_HAS_STD_TYPE_TRAITS
#define BOOST_NO_EXTERN_TEMPLATE #define BOOST_NO_CXX11_AUTO_DECLARATIONS
#define BOOST_NO_SCOPED_ENUMS #define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#define BOOST_NO_STATIC_ASSERT #define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_NO_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_DELETED_FUNCTIONS
#define BOOST_NO_CONSTEXPR #define BOOST_NO_CXX11_EXTERN_TEMPLATE
#define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_CXX11_LAMBDAS
#define BOOST_NO_RAW_LITERALS #define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
#define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_CXX11_NULLPTR
#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CXX11_RANGE_BASED_FOR
#define BOOST_NO_CXX11_RAW_LITERALS
#define BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_CXX11_TEMPLATE_ALIASES
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
// //
// TR1 macros: // TR1 macros:
@ -96,7 +121,7 @@
#define BOOST_HAS_MACRO_USE_FACET #define BOOST_HAS_MACRO_USE_FACET
#define BOOST_NO_INITIALIZER_LISTS #define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
// On non-Win32 platforms let the platform config figure this out: // On non-Win32 platforms let the platform config figure this out:
#ifdef _WIN32 #ifdef _WIN32
@ -112,7 +137,7 @@
// //
// check for exception handling support: // check for exception handling support:
// //
#if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS) #if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS # define BOOST_NO_EXCEPTIONS
#endif #endif
// //
@ -124,8 +149,9 @@
// //
// all versions support __declspec: // all versions support __declspec:
// //
#if !defined(__STRICT_ANSI__) #if defined(__STRICT_ANSI__)
# define BOOST_HAS_DECLSPEC // config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
# define BOOST_SYMBOL_EXPORT
#endif #endif
// //
// ABI fixing headers: // ABI fixing headers:

View File

@ -43,13 +43,8 @@
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
#endif #endif
#if (__EDG_VERSION__ <= 310) || !defined(BOOST_STRICT_CONFIG)
// No support for initializer lists
# define BOOST_NO_INITIALIZER_LISTS
#endif
// See also kai.hpp which checks a Kai-specific symbol for EH // See also kai.hpp which checks a Kai-specific symbol for EH
# if !defined(__KCC) && !defined(__EXCEPTIONS) # if !defined(__KCC) && !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS # define BOOST_NO_EXCEPTIONS
# endif # endif
@ -64,27 +59,45 @@
// //
// See above for BOOST_NO_LONG_LONG // See above for BOOST_NO_LONG_LONG
// //
#define BOOST_NO_CHAR16_T #if (__EDG_VERSION__ < 310)
#define BOOST_NO_CHAR32_T # define BOOST_NO_CXX11_EXTERN_TEMPLATE
#define BOOST_NO_CONSTEXPR #endif
#define BOOST_NO_DECLTYPE #if (__EDG_VERSION__ <= 310)
#define BOOST_NO_DEFAULTED_FUNCTIONS // No support for initializer lists
#define BOOST_NO_DELETED_FUNCTIONS # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #endif
#define BOOST_NO_EXTERN_TEMPLATE #if (__EDG_VERSION__ < 400)
#define BOOST_NO_RAW_LITERALS # define BOOST_NO_CXX11_VARIADIC_MACROS
#define BOOST_NO_RVALUE_REFERENCES #endif
#define BOOST_NO_SCOPED_ENUMS
#define BOOST_NO_STATIC_ASSERT #define BOOST_NO_CXX11_AUTO_DECLARATIONS
#define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#define BOOST_NO_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_CHAR16_T
#define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_CXX11_CHAR32_T
#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_CXX11_DECLTYPE
#define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_NO_CXX11_DELETED_FUNCTIONS
#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_CXX11_LAMBDAS
#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
#define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_NULLPTR
#define BOOST_NO_CXX11_RANGE_BASED_FOR
#define BOOST_NO_CXX11_RAW_LITERALS
#define BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_CXX11_STATIC_ASSERT
#define BOOST_NO_CXX11_TEMPLATE_ALIASES
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#ifdef c_plusplus #ifdef c_plusplus
// EDG has "long long" in non-strict mode // EDG has "long long" in non-strict mode
// However, some libraries have insufficient "long long" support // However, some libraries have insufficient "long long" support
// #define BOOST_HAS_LONG_LONG // #define BOOST_HAS_LONG_LONG
#endif #endif

View File

@ -26,7 +26,6 @@
#define BOOST_NO_SFINAE #define BOOST_NO_SFINAE
#define BOOST_NO_USING_TEMPLATE #define BOOST_NO_USING_TEMPLATE
#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL #define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
#define BOOST_NO_INITIALIZER_LISTS
#endif #endif
// //
@ -45,36 +44,53 @@
// //
// Is this really the best way to detect whether the std lib is in namespace std? // Is this really the best way to detect whether the std lib is in namespace std?
// //
#ifdef __cplusplus
#include <cstddef> #include <cstddef>
#endif
#if !defined(__STL_IMPORT_VENDOR_CSTD) && !defined(_STLP_IMPORT_VENDOR_CSTD) #if !defined(__STL_IMPORT_VENDOR_CSTD) && !defined(_STLP_IMPORT_VENDOR_CSTD)
# define BOOST_NO_STDC_NAMESPACE # define BOOST_NO_STDC_NAMESPACE
#endif #endif
// check for exception handling support: // check for exception handling support:
#ifndef _CPPUNWIND #if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS # define BOOST_NO_EXCEPTIONS
#endif #endif
// //
// C++0x features // C++0x features
// //
#define BOOST_NO_CHAR16_T #define BOOST_NO_CXX11_AUTO_DECLARATIONS
#define BOOST_NO_CHAR32_T #define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#define BOOST_NO_CONSTEXPR #define BOOST_NO_CXX11_CHAR16_T
#define BOOST_NO_DECLTYPE #define BOOST_NO_CXX11_CHAR32_T
#define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_CXX11_DECLTYPE
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_EXTERN_TEMPLATE #define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_NO_RAW_LITERALS #define BOOST_NO_CXX11_DELETED_FUNCTIONS
#define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_SCOPED_ENUMS #define BOOST_NO_CXX11_EXTERN_TEMPLATE
#define BOOST_NO_STATIC_ASSERT #define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_CXX11_LAMBDAS
#define BOOST_NO_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
#define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CXX11_NULLPTR
#define BOOST_NO_CXX11_RANGE_BASED_FOR
#define BOOST_NO_CXX11_RAW_LITERALS
#define BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_CXX11_STATIC_ASSERT
#define BOOST_NO_CXX11_TEMPLATE_ALIASES
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#if (__DMC__ < 0x812)
#define BOOST_NO_CXX11_VARIADIC_MACROS
#endif
#if __DMC__ < 0x800 #if __DMC__ < 0x800
#error "Compiler not supported or configured - please reconfigure" #error "Compiler not supported or configured - please reconfigure"
#endif #endif

View File

@ -42,6 +42,9 @@
# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
# define BOOST_NO_IS_ABSTRACT # define BOOST_NO_IS_ABSTRACT
# define BOOST_NO_CXX11_EXTERN_TEMPLATE
// Variadic macros do not exist for gcc versions before 3.0
# define BOOST_NO_CXX11_VARIADIC_MACROS
#elif __GNUC__ == 3 #elif __GNUC__ == 3
# if defined (__PATHSCALE__) # if defined (__PATHSCALE__)
# define BOOST_NO_TWO_PHASE_NAME_LOOKUP # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
@ -58,15 +61,31 @@
# if __GNUC_MINOR__ < 4 # if __GNUC_MINOR__ < 4
# define BOOST_NO_IS_ABSTRACT # define BOOST_NO_IS_ABSTRACT
# endif # endif
# define BOOST_NO_CXX11_EXTERN_TEMPLATE
#endif #endif
#if __GNUC__ < 4 #if __GNUC__ < 4
// //
// All problems to gcc-3.x and earlier here: // All problems to gcc-3.x and earlier here:
// //
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
# ifdef __OPEN64__
# define BOOST_NO_IS_ABSTRACT
# endif
#endif #endif
#ifndef __EXCEPTIONS #if __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 4 )
// Previous versions of GCC did not completely implement value-initialization:
// GCC Bug 30111, "Value-initialization of POD base class doesn't initialize
// members", reported by Jonathan Wakely in 2006,
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30111 (fixed for GCC 4.4)
// GCC Bug 33916, "Default constructor fails to initialize array members",
// reported by Michael Elizabeth Chastain in 2007,
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33916 (fixed for GCC 4.2.4)
// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
#endif
#if !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS # define BOOST_NO_EXCEPTIONS
#endif #endif
@ -91,33 +110,45 @@
#if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 ) #if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 )
#define BOOST_HAS_NRVO #define BOOST_HAS_NRVO
#endif #endif
//
// Dynamic shared object (DSO) and dynamic-link library (DLL) support
//
#if __GNUC__ >= 4
# if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(__CYGWIN__)
// All Win32 development environments, including 64-bit Windows and MinGW, define
// _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment,
// so does not define _WIN32 or its variants.
# define BOOST_HAS_DECLSPEC
# define BOOST_SYMBOL_EXPORT __attribute__((dllexport))
# define BOOST_SYMBOL_IMPORT __attribute__((dllimport))
# else
# define BOOST_SYMBOL_EXPORT __attribute__((visibility("default")))
# define BOOST_SYMBOL_IMPORT
# endif
# define BOOST_SYMBOL_VISIBLE __attribute__((visibility("default")))
#else
// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
# define BOOST_SYMBOL_EXPORT
#endif
// //
// RTTI and typeinfo detection is possible post gcc-4.3: // RTTI and typeinfo detection is possible post gcc-4.3:
// //
#if __GNUC__ * 100 + __GNUC_MINOR__ >= 403 #if __GNUC__ * 100 + __GNUC_MINOR__ >= 403
# ifndef __GXX_RTTI # ifndef __GXX_RTTI
# define BOOST_NO_TYPEID # ifndef BOOST_NO_TYPEID
# define BOOST_NO_RTTI # define BOOST_NO_TYPEID
# endif
# ifndef BOOST_NO_RTTI
# define BOOST_NO_RTTI
# endif
# endif # endif
#endif #endif
//
// C++0x features
//
#define BOOST_NO_CHAR16_T
#define BOOST_NO_CHAR32_T
#define BOOST_NO_CONSTEXPR
#define BOOST_NO_DEFAULTED_FUNCTIONS
#define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_EXTERN_TEMPLATE
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_SCOPED_ENUMS
#define BOOST_NO_UNICODE_LITERALS
// See below for BOOST_NO_AUTO_DECLARATIONS
#define BOOST_NO_AUTO_MULTIDECLARATIONS
// C++0x features in 4.3.n and later
//
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && defined(__GXX_EXPERIMENTAL_CXX0X__) #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
// C++0x features are only enabled when -std=c++0x or -std=gnu++0x are // C++0x features are only enabled when -std=c++0x or -std=gnu++0x are
// passed on the command line, which in turn defines // passed on the command line, which in turn defines
@ -127,22 +158,73 @@
# define BOOST_HAS_STATIC_ASSERT # define BOOST_HAS_STATIC_ASSERT
# define BOOST_HAS_VARIADIC_TMPL # define BOOST_HAS_VARIADIC_TMPL
#else #else
# define BOOST_NO_DECLTYPE # define BOOST_NO_CXX11_DECLTYPE
# define BOOST_NO_RVALUE_REFERENCES # define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
# define BOOST_NO_STATIC_ASSERT # define BOOST_NO_CXX11_RVALUE_REFERENCES
# define BOOST_NO_CXX11_STATIC_ASSERT
// Variadic templates compiler: // Variadic templates compiler:
// http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html // http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html
# ifdef __VARIADIC_TEMPLATES # if defined(__VARIADIC_TEMPLATES) || (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4) && defined(__GXX_EXPERIMENTAL_CXX0X__))
# define BOOST_HAS_VARIADIC_TMPL # define BOOST_HAS_VARIADIC_TMPL
# else # else
# define BOOST_NO_VARIADIC_TEMPLATES # define BOOST_NO_CXX11_VARIADIC_TEMPLATES
# endif # endif
#endif #endif
#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) // C++0x features in 4.4.n and later
# define BOOST_NO_INITIALIZER_LISTS //
# define BOOST_NO_AUTO_DECLARATIONS #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
# define BOOST_NO_CXX11_AUTO_DECLARATIONS
# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
# define BOOST_NO_CXX11_CHAR16_T
# define BOOST_NO_CXX11_CHAR32_T
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
# define BOOST_NO_CXX11_DELETED_FUNCTIONS
#endif
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
# define BOOST_NO_SFINAE_EXPR
#endif
// C++0x features in 4.5.0 and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
# define BOOST_NO_CXX11_LAMBDAS
# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
# define BOOST_NO_CXX11_RAW_LITERALS
# define BOOST_NO_CXX11_UNICODE_LITERALS
#endif
// C++0x features in 4.5.1 and later
//
#if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40501) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
// scoped enums have a serious bug in 4.4.0, so define BOOST_NO_CXX11_SCOPED_ENUMS before 4.5.1
// See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
# define BOOST_NO_CXX11_SCOPED_ENUMS
#endif
// C++0x features in 4.6.n and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
#define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_NULLPTR
#define BOOST_NO_CXX11_RANGE_BASED_FOR
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#endif
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
# define BOOST_NO_CXX11_TEMPLATE_ALIASES
#endif
// C++0x features not supported at all yet
//
#define BOOST_NO_CXX11_DECLTYPE_N3276
#ifndef BOOST_COMPILER
# define BOOST_COMPILER "GNU C++ version " __VERSION__
#endif #endif
// ConceptGCC compiler: // ConceptGCC compiler:
@ -152,19 +234,14 @@
# define BOOST_COMPILER "ConceptGCC version " __VERSION__ # define BOOST_COMPILER "ConceptGCC version " __VERSION__
#endif #endif
#ifndef BOOST_COMPILER
# define BOOST_COMPILER "GNU C++ version " __VERSION__
#endif
//
// versions check: // versions check:
// we don't know gcc prior to version 2.90: // we don't know gcc prior to version 2.90:
#if (__GNUC__ == 2) && (__GNUC_MINOR__ < 90) #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 90)
# error "Compiler not configured - please reconfigure" # error "Compiler not configured - please reconfigure"
#endif #endif
// //
// last known and checked version is 4.3 (Pre-release): // last known and checked version is 4.6 (Pre-release):
#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 3)) #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 6))
# if defined(BOOST_ASSERT_CONFIG) # if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results" # error "Unknown compiler version - please run the configure tests and report the results"
# else # else

View File

@ -25,6 +25,36 @@
// //
#define BOOST_HAS_LONG_LONG #define BOOST_HAS_LONG_LONG
// C++0x features:
//
# define BOOST_NO_CXX11_CONSTEXPR
# define BOOST_NO_CXX11_NULLPTR
# define BOOST_NO_CXX11_TEMPLATE_ALIASES
# define BOOST_NO_CXX11_DECLTYPE
# define BOOST_NO_CXX11_DECLTYPE_N3276
# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
# define BOOST_NO_CXX11_RVALUE_REFERENCES
# define BOOST_NO_CXX11_STATIC_ASSERT
# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
# define BOOST_NO_CXX11_VARIADIC_MACROS
# define BOOST_NO_CXX11_AUTO_DECLARATIONS
# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
# define BOOST_NO_CXX11_CHAR16_T
# define BOOST_NO_CXX11_CHAR32_T
# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
# define BOOST_NO_CXX11_DELETED_FUNCTIONS
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
# define BOOST_NO_CXX11_SCOPED_ENUMS
# define BOOST_NO_SFINAE_EXPR
# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
# define BOOST_NO_CXX11_LAMBDAS
# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
# define BOOST_NO_CXX11_RANGE_BASED_FOR
# define BOOST_NO_CXX11_RAW_LITERALS
# define BOOST_NO_CXX11_UNICODE_LITERALS
# define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#define BOOST_COMPILER "GCC-XML C++ version " __GCCXML__ #define BOOST_COMPILER "GCC-XML C++ version " __GCCXML__

View File

@ -90,22 +90,45 @@
// //
// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG // See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
// //
#define BOOST_NO_CHAR16_T #if !defined(__EDG__)
#define BOOST_NO_CHAR32_T
#define BOOST_NO_CONSTEXPR #define BOOST_NO_CXX11_AUTO_DECLARATIONS
#define BOOST_NO_DECLTYPE #define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_CXX11_CHAR16_T
#define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_CXX11_CHAR32_T
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_EXTERN_TEMPLATE #define BOOST_NO_CXX11_DECLTYPE
#define BOOST_NO_RAW_LITERALS #define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_NO_SCOPED_ENUMS #define BOOST_NO_CXX11_DELETED_FUNCTIONS
#define BOOST_NO_STATIC_ASSERT #define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_CXX11_EXTERN_TEMPLATE
#define BOOST_NO_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CXX11_LAMBDAS
#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
#define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_NULLPTR
#define BOOST_NO_CXX11_RANGE_BASED_FOR
#define BOOST_NO_CXX11_RAW_LITERALS
#define BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_CXX11_STATIC_ASSERT
#define BOOST_NO_CXX11_TEMPLATE_ALIASES
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
/*
See https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443331 and
https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443436
*/
#if (__HP_aCC < 62500) || !defined(HP_CXX0x_SOURCE)
#define BOOST_NO_CXX11_VARIADIC_MACROS
#endif
#endif
// //
// last known and checked version for HP-UX/ia64 is 61300 // last known and checked version for HP-UX/ia64 is 61300

View File

@ -26,7 +26,19 @@
# define BOOST_INTEL_CXX_VERSION __ECC # define BOOST_INTEL_CXX_VERSION __ECC
#endif #endif
// Flags determined by comparing output of 'icpc -dM -E' with and without '-std=c++0x'
#if (!(defined(_WIN32) || defined(_WIN64)) && defined(__STDC_HOSTED__) && (__STDC_HOSTED__ && (BOOST_INTEL_CXX_VERSION <= 1200))) || defined(__GXX_EXPERIMENTAL_CPP0X__)
# define BOOST_INTEL_STDCXX0X
#endif
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
# define BOOST_INTEL_STDCXX0X
#endif
#ifdef BOOST_INTEL_STDCXX0X
#define BOOST_COMPILER "Intel C++ C++0x mode version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION)
#else
#define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION) #define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION)
#endif
#define BOOST_INTEL BOOST_INTEL_CXX_VERSION #define BOOST_INTEL BOOST_INTEL_CXX_VERSION
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)
@ -99,7 +111,7 @@
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
# endif # endif
#endif #endif
#if (defined(__GNUC__) && (__GNUC__ < 4)) || defined(_WIN32) || (BOOST_INTEL_CXX_VERSION <= 1100) #if (defined(__GNUC__) && (__GNUC__ < 4)) || defined(_WIN32) || (BOOST_INTEL_CXX_VERSION <= 1200)
// GCC or VC emulation: // GCC or VC emulation:
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#endif #endif
@ -109,6 +121,7 @@
// in type_traits code among other things, getting this correct // in type_traits code among other things, getting this correct
// for the Intel compiler is actually remarkably fragile and tricky: // for the Intel compiler is actually remarkably fragile and tricky:
// //
#ifdef __cplusplus
#if defined(BOOST_NO_INTRINSIC_WCHAR_T) #if defined(BOOST_NO_INTRINSIC_WCHAR_T)
#include <cwchar> #include <cwchar>
template< typename T > struct assert_no_intrinsic_wchar_t; template< typename T > struct assert_no_intrinsic_wchar_t;
@ -122,8 +135,9 @@ template<> struct assert_intrinsic_wchar_t<wchar_t> {};
// if you see an error here then define BOOST_NO_INTRINSIC_WCHAR_T on the command line: // if you see an error here then define BOOST_NO_INTRINSIC_WCHAR_T on the command line:
template<> struct assert_intrinsic_wchar_t<unsigned short> {}; template<> struct assert_intrinsic_wchar_t<unsigned short> {};
#endif #endif
#endif
#if _MSC_VER+0 >= 1000 #if defined(_MSC_VER) && (_MSC_VER+0 >= 1000)
# if _MSC_VER >= 1200 # if _MSC_VER >= 1200
# define BOOST_HAS_MS_INT64 # define BOOST_HAS_MS_INT64
# endif # endif
@ -157,31 +171,94 @@ template<> struct assert_intrinsic_wchar_t<unsigned short> {};
# define BOOST_NO_TWO_PHASE_NAME_LOOKUP # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#endif #endif
//
// An attempt to value-initialize a pointer-to-member may trigger an
// internal error on Intel <= 11.1 (last checked version), as was
// reported by John Maddock, Intel support issue 589832, May 2010.
// Moreover, according to test results from Huang-Vista-x86_32_intel,
// intel-vc9-win-11.1 may leave a non-POD array uninitialized, in some
// cases when it should be value-initialized.
// (Niels Dekker, LKEB, May 2010)
// Apparently Intel 12.1 (compiler version number 9999 !!) has the same issue (compiler regression).
#if defined(__INTEL_COMPILER)
# if (__INTEL_COMPILER <= 1110) || (__INTEL_COMPILER == 9999)
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
# endif
#endif
//
// Dynamic shared object (DSO) and dynamic-link library (DLL) support
//
#if defined(__GNUC__) && (__GNUC__ >= 4)
# define BOOST_SYMBOL_EXPORT __attribute__((visibility("default")))
# define BOOST_SYMBOL_IMPORT
# define BOOST_SYMBOL_VISIBLE __attribute__((visibility("default")))
#endif
// //
// C++0x features // C++0x features
// - ICC added static_assert in 11.0 (first version with C++0x support)
// //
// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG #if defined(BOOST_INTEL_STDCXX0X)
# undef BOOST_NO_CXX11_STATIC_ASSERT
// //
#define BOOST_NO_CHAR16_T // These pass our test cases, but aren't officially supported according to:
#define BOOST_NO_CHAR32_T // http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler/
#define BOOST_NO_CONSTEXPR //
#define BOOST_NO_DECLTYPE //# undef BOOST_NO_CXX11_LAMBDAS
#define BOOST_NO_DEFAULTED_FUNCTIONS //# undef BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
#define BOOST_NO_DELETED_FUNCTIONS //# undef BOOST_NO_CXX11_DECLTYPE
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS //# undef BOOST_NO_CXX11_AUTO_DECLARATIONS
#define BOOST_NO_EXTERN_TEMPLATE //# undef BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#define BOOST_NO_RAW_LITERALS #endif
#define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_SCOPED_ENUMS #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION >= 1200)
#define BOOST_NO_STATIC_ASSERT //# undef BOOST_NO_CXX11_RVALUE_REFERENCES // Enabling this breaks Filesystem and Exception libraries
#define BOOST_NO_UNICODE_LITERALS //# undef BOOST_NO_CXX11_SCOPED_ENUMS // doesn't really work!!
#define BOOST_NO_VARIADIC_TEMPLATES # undef BOOST_NO_CXX11_DELETED_FUNCTIONS
#define BOOST_NO_AUTO_DECLARATIONS # undef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_NO_AUTO_MULTIDECLARATIONS # undef BOOST_NO_CXX11_LAMBDAS
# undef BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
# undef BOOST_NO_CXX11_DECLTYPE
# undef BOOST_NO_CXX11_AUTO_DECLARATIONS
# undef BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#endif
// icl Version 12.1.0.233 Build 20110811 and possibly some other builds
// had an incorrect __INTEL_COMPILER value of 9999. Intel say this has been fixed.
#if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION > 1200)
# undef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
# undef BOOST_NO_CXX11_NULLPTR
# undef BOOST_NO_CXX11_RVALUE_REFERENCES
# undef BOOST_NO_SFINAE_EXPR
# undef BOOST_NO_CXX11_TEMPLATE_ALIASES
# undef BOOST_NO_CXX11_VARIADIC_TEMPLATES
// http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler/
// continues to list scoped enum support as "Partial"
//# undef BOOST_NO_CXX11_SCOPED_ENUMS
#endif
#if defined(_MSC_VER) && (_MSC_VER <= 1700)
//
// Although the Intel compiler is capable of supporting these, it appears not to in MSVC compatibility mode:
//
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
# define BOOST_NO_CXX11_DELETED_FUNCTIONS
# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
# define BOOST_NO_CXX11_TEMPLATE_ALIASES
#endif
#if (BOOST_INTEL_CXX_VERSION < 1200)
//
// fenv.h appears not to work with Intel prior to 12.0:
//
# define BOOST_NO_FENV_H
#endif
// //
// last known and checked version: // last known and checked version:
#if (BOOST_INTEL_CXX_VERSION > 1100) #if (BOOST_INTEL_CXX_VERSION > 1200)
# if defined(BOOST_ASSERT_CONFIG) # if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results" # error "Unknown compiler version - please run the configure tests and report the results"
# elif defined(_MSC_VER) # elif defined(_MSC_VER)

View File

@ -17,12 +17,10 @@
# endif # endif
// see also common_edg.hpp which needs a special check for __KCC // see also common_edg.hpp which needs a special check for __KCC
# if !defined(_EXCEPTIONS) # if !defined(_EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS # define BOOST_NO_EXCEPTIONS
# endif # endif
#define BOOST_COMPILER "Kai C++ version " BOOST_STRINGIZE(__KCC_VERSION)
// //
// last known and checked version is 4001: // last known and checked version is 4001:
#if (__KCC_VERSION > 4001) #if (__KCC_VERSION > 4001)

View File

@ -39,17 +39,16 @@
// the "|| !defined(BOOST_STRICT_CONFIG)" part should apply to the last // the "|| !defined(BOOST_STRICT_CONFIG)" part should apply to the last
// tested version *only*: // tested version *only*:
# if(__MWERKS__ <= 0x3206) || !defined(BOOST_STRICT_CONFIG) // 9.5 # if(__MWERKS__ <= 0x3207) || !defined(BOOST_STRICT_CONFIG) // 9.6
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# define BOOST_NO_IS_ABSTRACT # define BOOST_NO_IS_ABSTRACT
# define BOOST_NO_INITIALIZER_LISTS
# endif # endif
#if !__option(wchar_type) #if !__option(wchar_type)
# define BOOST_NO_INTRINSIC_WCHAR_T # define BOOST_NO_INTRINSIC_WCHAR_T
#endif #endif
#if !__option(exceptions) #if !__option(exceptions) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS # define BOOST_NO_EXCEPTIONS
#endif #endif
@ -74,6 +73,8 @@
# define BOOST_COMPILER_VERSION 9.4 # define BOOST_COMPILER_VERSION 9.4
# elif __MWERKS__ == 0x3206 # elif __MWERKS__ == 0x3206
# define BOOST_COMPILER_VERSION 9.5 # define BOOST_COMPILER_VERSION 9.5
# elif __MWERKS__ == 0x3207
# define BOOST_COMPILER_VERSION 9.6
# else # else
# define BOOST_COMPILER_VERSION __MWERKS__ # define BOOST_COMPILER_VERSION __MWERKS__
# endif # endif
@ -89,23 +90,35 @@
#if __MWERKS__ > 0x3206 && __option(rvalue_refs) #if __MWERKS__ > 0x3206 && __option(rvalue_refs)
# define BOOST_HAS_RVALUE_REFS # define BOOST_HAS_RVALUE_REFS
#else #else
# define BOOST_NO_RVALUE_REFERENCES # define BOOST_NO_CXX11_RVALUE_REFERENCES
#endif #endif
#define BOOST_NO_CHAR16_T #define BOOST_NO_CXX11_AUTO_DECLARATIONS
#define BOOST_NO_CHAR32_T #define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#define BOOST_NO_CONSTEXPR #define BOOST_NO_CXX11_CHAR16_T
#define BOOST_NO_DECLTYPE #define BOOST_NO_CXX11_CHAR32_T
#define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_CXX11_DECLTYPE
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_EXTERN_TEMPLATE #define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_NO_RAW_LITERALS #define BOOST_NO_CXX11_DELETED_FUNCTIONS
#define BOOST_NO_SCOPED_ENUMS #define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_STATIC_ASSERT #define BOOST_NO_CXX11_EXTERN_TEMPLATE
#define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_CXX11_LAMBDAS
#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
#define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_NULLPTR
#define BOOST_NO_CXX11_RANGE_BASED_FOR
#define BOOST_NO_CXX11_RAW_LITERALS
#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_CXX11_STATIC_ASSERT
#define BOOST_NO_CXX11_TEMPLATE_ALIASES
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_VARIADIC_MACROS
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION) #define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)

View File

@ -33,7 +33,6 @@
# define BOOST_NO_STD_ALLOCATOR /* actually a bug with const reference overloading */ # define BOOST_NO_STD_ALLOCATOR /* actually a bug with const reference overloading */
# define BOOST_NO_INITIALIZER_LISTS
#endif #endif
// //
@ -41,22 +40,34 @@
// //
// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG // See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
// //
#define BOOST_NO_CHAR16_T #define BOOST_NO_CXX11_AUTO_DECLARATIONS
#define BOOST_NO_CHAR32_T #define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#define BOOST_NO_CONSTEXPR #define BOOST_NO_CXX11_CHAR16_T
#define BOOST_NO_DECLTYPE #define BOOST_NO_CXX11_CHAR32_T
#define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_CXX11_DECLTYPE
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_EXTERN_TEMPLATE #define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_NO_RAW_LITERALS #define BOOST_NO_CXX11_DELETED_FUNCTIONS
#define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_SCOPED_ENUMS #define BOOST_NO_CXX11_EXTERN_TEMPLATE
#define BOOST_NO_STATIC_ASSERT #define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#define BOOST_NO_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_LAMBDAS
#define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_NULLPTR
#define BOOST_NO_CXX11_RANGE_BASED_FOR
#define BOOST_NO_CXX11_RAW_LITERALS
#define BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_CXX11_STATIC_ASSERT
#define BOOST_NO_CXX11_TEMPLATE_ALIASES
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_VARIADIC_MACROS
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
// //
// versions check: // versions check:

View File

@ -1,6 +1,6 @@
// (C) Copyright Noel Belcourt 2007. // (C) Copyright Noel Belcourt 2007.
// Use, modification and distribution are subject to the // Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file // Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version. // See http://www.boost.org for most recent version.
@ -8,7 +8,7 @@
// PGI C++ compiler setup: // PGI C++ compiler setup:
#define BOOST_COMPILER_VERSION __PGIC__##__PGIC_MINOR__ #define BOOST_COMPILER_VERSION __PGIC__##__PGIC_MINOR__
#define BOOST_COMPILER "PGI compiler version " BOOST_STRINGIZE(_COMPILER_VERSION) #define BOOST_COMPILER "PGI compiler version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
// //
// Threading support: // Threading support:
@ -16,12 +16,44 @@
// if no threading API is detected. // if no threading API is detected.
// //
#if (__PGIC__ >= 7) #if __PGIC__ >= 11
#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL // options requested by configure --enable-test
#define BOOST_HAS_PTHREADS
#define BOOST_HAS_THREADS
#define BOOST_HAS_PTHREAD_YIELD
#define BOOST_HAS_NRVO
#define BOOST_HAS_LONG_LONG
// options --enable-test wants undefined
#undef BOOST_NO_STDC_NAMESPACE
#undef BOOST_NO_EXCEPTION_STD_NAMESPACE
#undef BOOST_DEDUCED_TYPENAME
#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#define BOOST_NO_CXX11_AUTO_DECLARATIONS
#elif __PGIC__ >= 10
// options requested by configure --enable-test
#define BOOST_HAS_THREADS
#define BOOST_HAS_NRVO
#define BOOST_HAS_LONG_LONG
// options --enable-test wants undefined
#undef BOOST_NO_STDC_NAMESPACE
#undef BOOST_NO_EXCEPTION_STD_NAMESPACE
#undef BOOST_DEDUCED_TYPENAME
#elif __PGIC__ >= 7
#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#define BOOST_NO_SWPRINTF #define BOOST_NO_SWPRINTF
#define BOOST_NO_INITIALIZER_LISTS #define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#define BOOST_NO_CXX11_AUTO_DECLARATIONS
#else #else
@ -33,22 +65,52 @@
// //
// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG // See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
// //
#define BOOST_NO_CHAR16_T #define BOOST_NO_CXX11_CHAR16_T
#define BOOST_NO_CHAR32_T #define BOOST_NO_CXX11_CHAR32_T
#define BOOST_NO_CONSTEXPR #define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_DECLTYPE #define BOOST_NO_CXX11_DECLTYPE
#define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_CXX11_DELETED_FUNCTIONS
#define BOOST_NO_EXTERN_TEMPLATE #define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_RAW_LITERALS #define BOOST_NO_CXX11_EXTERN_TEMPLATE
#define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_SCOPED_ENUMS #define BOOST_NO_CXX11_LAMBDAS
#define BOOST_NO_STATIC_ASSERT #define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
#define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_NULLPTR
#define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_CXX11_NUMERIC_LIMITS
#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CXX11_RANGE_BASED_FOR
#define BOOST_NO_CXX11_RAW_LITERALS
#define BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_CXX11_STATIC_ASSERT
#define BOOST_NO_SWPRINTF
#define BOOST_NO_CXX11_TEMPLATE_ALIASES
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_VARIADIC_MACROS
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#define BOOST_NO_CXX11_HDR_UNORDERED_SET
#define BOOST_NO_CXX11_HDR_UNORDERED_MAP
#define BOOST_NO_CXX11_HDR_TYPEINDEX
#define BOOST_NO_CXX11_HDR_TYPE_TRAITS
#define BOOST_NO_CXX11_HDR_TUPLE
#define BOOST_NO_CXX11_HDR_THREAD
#define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
#define BOOST_NO_CXX11_HDR_REGEX
#define BOOST_NO_CXX11_HDR_RATIO
#define BOOST_NO_CXX11_HDR_RANDOM
#define BOOST_NO_CXX11_HDR_MUTEX
#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#define BOOST_NO_CXX11_HDR_FUTURE
#define BOOST_NO_CXX11_HDR_FORWARD_LIST
#define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
#define BOOST_NO_CXX11_HDR_CODECVT
#define BOOST_NO_CXX11_HDR_CHRONO
#define BOOST_NO_CXX11_HDR_ARRAY
// //
// version check: // version check:

View File

@ -22,29 +22,6 @@
#undef BOOST_NO_SWPRINTF #undef BOOST_NO_SWPRINTF
#undef BOOST_DEDUCED_TYPENAME #undef BOOST_DEDUCED_TYPENAME
#define BOOST_NO_INITIALIZER_LISTS
//
// C++0x features
//
// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
//
#define BOOST_NO_CHAR16_T
#define BOOST_NO_CHAR32_T
#define BOOST_NO_CONSTEXPR
#define BOOST_NO_DECLTYPE
#define BOOST_NO_DEFAULTED_FUNCTIONS
#define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_EXTERN_TEMPLATE
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_SCOPED_ENUMS
#define BOOST_NO_STATIC_ASSERT
#define BOOST_NO_UNICODE_LITERALS
#define BOOST_NO_VARIADIC_TEMPLATES
#define BOOST_NO_AUTO_DECLARATIONS
#define BOOST_NO_AUTO_MULTIDECLARATIONS
// //
// version check: // version check:
// probably nothing to do here? // probably nothing to do here?

View File

@ -69,39 +69,64 @@
# define BOOST_NO_IS_ABSTRACT # define BOOST_NO_IS_ABSTRACT
# endif # endif
# if (__SUNPRO_CC <= 0x5100)
// Sun 5.10 may not correctly value-initialize objects of
// some user defined types, as was reported in April 2010
// (CR 6947016), and confirmed by Steve Clamage.
// (Niels Dekker, LKEB, May 2010).
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
# endif
//
// Dynamic shared object (DSO) and dynamic-link library (DLL) support
//
#if __SUNPRO_CC > 0x500
# define BOOST_SYMBOL_EXPORT __global
# define BOOST_SYMBOL_IMPORT __global
# define BOOST_SYMBOL_VISIBLE __global
#endif
// //
// Issues that effect all known versions: // Issues that effect all known versions:
// //
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#define BOOST_NO_ADL_BARRIER #define BOOST_NO_ADL_BARRIER
#define BOOST_NO_INITIALIZER_LISTS
// //
// C++0x features // C++0x features
// //
#if(__SUNPRO_CC >= 0x590)
# define BOOST_HAS_LONG_LONG # define BOOST_HAS_LONG_LONG
#else
# define BOOST_NO_LONG_LONG
#endif
#define BOOST_NO_CHAR16_T #define BOOST_NO_CXX11_AUTO_DECLARATIONS
#define BOOST_NO_CHAR32_T #define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#define BOOST_NO_CONSTEXPR #define BOOST_NO_CXX11_CHAR16_T
#define BOOST_NO_DECLTYPE #define BOOST_NO_CXX11_CHAR32_T
#define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_CXX11_DECLTYPE
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_EXTERN_TEMPLATE #define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_NO_RAW_LITERALS #define BOOST_NO_CXX11_DELETED_FUNCTIONS
#define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_SCOPED_ENUMS #define BOOST_NO_CXX11_EXTERN_TEMPLATE
#define BOOST_NO_STATIC_ASSERT #define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#define BOOST_NO_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_LAMBDAS
#define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_NULLPTR
#define BOOST_NO_CXX11_RANGE_BASED_FOR
#define BOOST_NO_CXX11_RAW_LITERALS
#define BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_CXX11_STATIC_ASSERT
#define BOOST_NO_CXX11_TEMPLATE_ALIASES
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_VARIADIC_MACROS
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
// //
// Version // Version

View File

@ -27,7 +27,14 @@
#if (__IBMCPP__ <= 600) || !defined(BOOST_STRICT_CONFIG) #if (__IBMCPP__ <= 600) || !defined(BOOST_STRICT_CONFIG)
# define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS # define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
# define BOOST_NO_INITIALIZER_LISTS #endif
#if (__IBMCPP__ <= 1110)
// XL C++ V11.1 and earlier versions may not always value-initialize
// a temporary object T(), when T is a non-POD aggregate class type.
// Michael Wong (IBM Canada Ltd) has confirmed this issue and gave it
// high priority. -- Niels Dekker (LKEB), May 2010.
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
#endif #endif
// //
@ -46,37 +53,78 @@
#error "Compiler not supported or configured - please reconfigure" #error "Compiler not supported or configured - please reconfigure"
#endif #endif
// //
// last known and checked version is 600: // last known and checked version is 1110:
#if (__IBMCPP__ > 600) #if (__IBMCPP__ > 1110)
# if defined(BOOST_ASSERT_CONFIG) # if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results" # error "Unknown compiler version - please run the configure tests and report the results"
# endif # endif
#endif #endif
// Some versions of the compiler have issues with default arguments on partial specializations // Some versions of the compiler have issues with default arguments on partial specializations
#if __IBMCPP__ <= 1010
#define BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS #define BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
#endif
// //
// C++0x features // C++0x features
// //
// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG // See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
// //
#define BOOST_NO_CHAR16_T #if ! __IBMCPP_AUTO_TYPEDEDUCTION
#define BOOST_NO_CHAR32_T # define BOOST_NO_CXX11_AUTO_DECLARATIONS
#define BOOST_NO_CONSTEXPR # define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#define BOOST_NO_DECLTYPE #endif
#define BOOST_NO_DEFAULTED_FUNCTIONS #if ! __IBMCPP_UTF_LITERAL__
#define BOOST_NO_DELETED_FUNCTIONS # define BOOST_NO_CXX11_CHAR16_T
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS # define BOOST_NO_CXX11_CHAR32_T
#define BOOST_NO_EXTERN_TEMPLATE #endif
#define BOOST_NO_RAW_LITERALS #if ! __IBMCPP_CONSTEXPR
#define BOOST_NO_RVALUE_REFERENCES # define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_SCOPED_ENUMS #endif
#define BOOST_NO_STATIC_ASSERT #if ! __IBMCPP_DECLTYPE
#define BOOST_NO_UNICODE_LITERALS # define BOOST_NO_CXX11_DECLTYPE
#define BOOST_NO_VARIADIC_TEMPLATES #else
#define BOOST_NO_AUTO_DECLARATIONS # define BOOST_HAS_DECLTYPE
#define BOOST_NO_AUTO_MULTIDECLARATIONS #endif
#define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_NO_CXX11_DELETED_FUNCTIONS
#if ! __IBMCPP_EXPLICIT_CONVERSION_OPERATORS
# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
#endif
#if ! __IBMCPP_EXTERN_TEMPLATE
# define BOOST_NO_CXX11_EXTERN_TEMPLATE
#endif
#if ! __IBMCPP_VARIADIC_TEMPLATES
// not enabled separately at this time
# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#endif
#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#define BOOST_NO_CXX11_LAMBDAS
#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
#define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_NULLPTR
#define BOOST_NO_CXX11_RANGE_BASED_FOR
#define BOOST_NO_CXX11_RAW_LITERALS
#if ! __IBMCPP_RVALUE_REFERENCES
# define BOOST_NO_CXX11_RVALUE_REFERENCES
#endif
#if ! __IBMCPP_SCOPED_ENUM
# define BOOST_NO_CXX11_SCOPED_ENUMS
#endif
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#if ! __IBMCPP_STATIC_ASSERT
# define BOOST_NO_CXX11_STATIC_ASSERT
#endif
#define BOOST_NO_CXX11_TEMPLATE_ALIASES
#define BOOST_NO_CXX11_UNICODE_LITERALS
#if ! __IBMCPP_VARIADIC_TEMPLATES
# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#endif
#if ! __C99_MACRO_WITH_VA_ARGS
# define BOOST_NO_CXX11_VARIADIC_MACROS
#endif

View File

@ -9,29 +9,54 @@
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version. // See http://www.boost.org for most recent version.
//
// Microsoft Visual C++ compiler setup: // Microsoft Visual C++ compiler setup:
//
// We need to be careful with the checks in this file, as contrary
// to popular belief there are versions with _MSC_VER with the final
// digit non-zero (mainly the MIPS cross compiler).
//
// So we either test _MSC_VER >= XXXX or else _MSC_VER < XXXX.
// No other comparisons (==, >, or <=) are safe.
//
#define BOOST_MSVC _MSC_VER #define BOOST_MSVC _MSC_VER
// turn off the warnings before we #include anything //
// Helper macro BOOST_MSVC_FULL_VER for use in Boost code:
//
#if _MSC_FULL_VER > 100000000
# define BOOST_MSVC_FULL_VER _MSC_FULL_VER
#else
# define BOOST_MSVC_FULL_VER (_MSC_FULL_VER * 10)
#endif
// Attempt to suppress VC6 warnings about the length of decorated names (obsolete):
#pragma warning( disable : 4503 ) // warning: decorated name length exceeded #pragma warning( disable : 4503 ) // warning: decorated name length exceeded
//
// versions check:
// we don't support Visual C++ prior to version 6:
#if _MSC_VER < 1200
# error "Compiler not supported or configured - please reconfigure"
#endif
#if _MSC_VER < 1300 // 1200 == VC++ 6.0, 1200-1202 == eVC++4 #if _MSC_VER < 1300 // 1200 == VC++ 6.0, 1200-1202 == eVC++4
# pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info # pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS # define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
# define BOOST_NO_VOID_RETURNS # define BOOST_NO_VOID_RETURNS
# define BOOST_NO_EXCEPTION_STD_NAMESPACE # define BOOST_NO_EXCEPTION_STD_NAMESPACE
# if BOOST_MSVC == 1202 # if _MSC_VER == 1202
# define BOOST_NO_STD_TYPEINFO # define BOOST_NO_STD_TYPEINFO
# endif # endif
// disable min/max macro defines on vc6:
//
#endif #endif
#if (_MSC_VER <= 1300) // 1300 == VC++ 7.0 /// Visual Studio has no fenv.h
#define BOOST_NO_FENV_H
#if (_MSC_VER < 1310) // 130X == VC++ 7.0
# if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za # if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS # define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
@ -63,7 +88,7 @@
# define BOOST_NO_IS_ABSTRACT # define BOOST_NO_IS_ABSTRACT
# define BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS # define BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS
// TODO: what version is meant here? Have there really been any fixes in cl 12.01 (as e.g. shipped with eVC4)? // TODO: what version is meant here? Have there really been any fixes in cl 12.01 (as e.g. shipped with eVC4)?
# if (_MSC_VER > 1200) # if (_MSC_VER >= 1300)
# define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS # define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
# endif # endif
@ -73,6 +98,10 @@
// although a conforming signature for swprint exists in VC7.1 // although a conforming signature for swprint exists in VC7.1
// it appears not to actually work: // it appears not to actually work:
# define BOOST_NO_SWPRINTF # define BOOST_NO_SWPRINTF
// Our extern template tests also fail for this compiler:
# define BOOST_NO_CXX11_EXTERN_TEMPLATE
// Variadic macros do not exist for VC7.1 and lower
# define BOOST_NO_CXX11_VARIADIC_MACROS
#endif #endif
#if defined(UNDER_CE) #if defined(UNDER_CE)
@ -80,21 +109,33 @@
# define BOOST_NO_SWPRINTF # define BOOST_NO_SWPRINTF
#endif #endif
#if _MSC_VER <= 1400 // 1400 == VC++ 8.0 #if _MSC_VER < 1500 // 140X == VC++ 8.0
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
#endif #endif
#if _MSC_VER <= 1600 // 1600 == VC++ 10.0 #if _MSC_VER < 1600 // 150X == VC++ 9.0
# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#endif
#if _MSC_VER == 1500 // 1500 == VC++ 9.0
// A bug in VC9: // A bug in VC9:
# define BOOST_NO_ADL_BARRIER # define BOOST_NO_ADL_BARRIER
#endif #endif
#if _MSC_VER <= 1500 || !defined(BOOST_STRICT_CONFIG) // 1500 == VC++ 9.0
# define BOOST_NO_INITIALIZER_LISTS // MSVC (including the latest checked version) has not yet completely
// implemented value-initialization, as is reported:
// "VC++ does not value-initialize members of derived classes without
// user-declared constructor", reported in 2009 by Sylvester Hesp:
// https://connect.microsoft.com/VisualStudio/feedback/details/484295
// "Presence of copy constructor breaks member class initialization",
// reported in 2009 by Alex Vakulenko:
// https://connect.microsoft.com/VisualStudio/feedback/details/499606
// "Value-initialization in new-expression", reported in 2005 by
// Pavel Kuznetsov (MetaCommunications Engineering):
// https://connect.microsoft.com/VisualStudio/feedback/details/100744
// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
// (Niels Dekker, LKEB, May 2010)
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
#if _MSC_VER < 1600 || !defined(BOOST_STRICT_CONFIG) // 150X == VC++ 9.0
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#endif #endif
#ifndef _NATIVE_WCHAR_T_DEFINED #ifndef _NATIVE_WCHAR_T_DEFINED
@ -102,14 +143,18 @@
#endif #endif
#if defined(_WIN32_WCE) || defined(UNDER_CE) #if defined(_WIN32_WCE) || defined(UNDER_CE)
# define BOOST_NO_THREADEX
# define BOOST_NO_GETSYSTEMTIMEASFILETIME
# define BOOST_NO_SWPRINTF # define BOOST_NO_SWPRINTF
#endif #endif
// we have ThreadEx or GetSystemTimeAsFileTime unless we're running WindowsCE
#if !defined(_WIN32_WCE) && !defined(UNDER_CE)
# define BOOST_HAS_THREADEX
# define BOOST_HAS_GETSYSTEMTIMEASFILETIME
#endif
// //
// check for exception handling support: // check for exception handling support:
#ifndef _CPPUNWIND #if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS # define BOOST_NO_EXCEPTIONS
#endif #endif
@ -119,7 +164,7 @@
#if (_MSC_VER >= 1200) #if (_MSC_VER >= 1200)
# define BOOST_HAS_MS_INT64 # define BOOST_HAS_MS_INT64
#endif #endif
#if (_MSC_VER >= 1310) && defined(_MSC_EXTENSIONS) #if (_MSC_VER >= 1310) && (defined(_MSC_EXTENSIONS) || (_MSC_VER >= 1400))
# define BOOST_HAS_LONG_LONG # define BOOST_HAS_LONG_LONG
#else #else
# define BOOST_NO_LONG_LONG # define BOOST_NO_LONG_LONG
@ -131,42 +176,59 @@
// disable Win32 API's if compiler extentions are // disable Win32 API's if compiler extentions are
// turned off: // turned off:
// //
#ifndef _MSC_EXTENSIONS #if !defined(_MSC_EXTENSIONS) && !defined(BOOST_DISABLE_WIN32)
# define BOOST_DISABLE_WIN32 # define BOOST_DISABLE_WIN32
#endif #endif
#ifndef _CPPRTTI #if !defined(_CPPRTTI) && !defined(BOOST_NO_RTTI)
# define BOOST_NO_RTTI # define BOOST_NO_RTTI
#endif #endif
//
// all versions support __declspec:
//
#define BOOST_HAS_DECLSPEC
// //
// C++0x features // C++0x features
// //
// See above for BOOST_NO_LONG_LONG // See above for BOOST_NO_LONG_LONG
#define BOOST_NO_CHAR16_T
#define BOOST_NO_CHAR32_T
#define BOOST_NO_CONSTEXPR
#define BOOST_NO_DECLTYPE
#define BOOST_NO_DEFAULTED_FUNCTIONS
#define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_EXTERN_TEMPLATE
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_SCOPED_ENUMS
#define BOOST_NO_UNICODE_LITERALS
#define BOOST_NO_VARIADIC_TEMPLATES
// MSVC 2010 CTP has some support for C++0x, but we still disable it until the compiler release // C++ features supported by VC++ 10 (aka 2010)
// #if _MSC_VER < 1600 //
#define BOOST_NO_RVALUE_REFERENCES #if _MSC_VER < 1600
#define BOOST_NO_STATIC_ASSERT # define BOOST_NO_CXX11_AUTO_DECLARATIONS
#define BOOST_NO_AUTO_DECLARATIONS # define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#define BOOST_NO_AUTO_MULTIDECLARATIONS # define BOOST_NO_CXX11_LAMBDAS
// #endif // _MSC_VER < 1600 # define BOOST_NO_CXX11_RVALUE_REFERENCES
# define BOOST_NO_CXX11_STATIC_ASSERT
# define BOOST_NO_CXX11_NULLPTR
# define BOOST_NO_CXX11_DECLTYPE
#endif // _MSC_VER < 1600
#if _MSC_VER >= 1600
# define BOOST_HAS_STDINT_H
#endif
// C++ features supported by VC++ 11 (aka 2012)
//
#if _MSC_VER < 1700
# define BOOST_NO_CXX11_RANGE_BASED_FOR
# define BOOST_NO_CXX11_SCOPED_ENUMS
#endif // _MSC_VER < 1700
// C++0x features not supported by any versions
#define BOOST_NO_CXX11_CHAR16_T
#define BOOST_NO_CXX11_CHAR32_T
#define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_NO_CXX11_DELETED_FUNCTIONS
#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_RAW_LITERALS
#define BOOST_NO_CXX11_TEMPLATE_ALIASES
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
// //
// prefix and suffix headers: // prefix and suffix headers:
// //
@ -177,6 +239,7 @@
# define BOOST_ABI_SUFFIX "boost/config/abi/msvc_suffix.hpp" # define BOOST_ABI_SUFFIX "boost/config/abi/msvc_suffix.hpp"
#endif #endif
#ifndef BOOST_COMPILER
// TODO: // TODO:
// these things are mostly bogus. 1200 means version 12.0 of the compiler. The // these things are mostly bogus. 1200 means version 12.0 of the compiler. The
// artificial versions assigned to them only refer to the versions of some IDE // artificial versions assigned to them only refer to the versions of some IDE
@ -188,12 +251,21 @@
// Note: these are so far off, they are not really supported // Note: these are so far off, they are not really supported
# elif _MSC_VER < 1300 // eVC++ 4 comes with 1200-1202 # elif _MSC_VER < 1300 // eVC++ 4 comes with 1200-1202
# define BOOST_COMPILER_VERSION evc4.0 # define BOOST_COMPILER_VERSION evc4.0
# elif _MSC_VER == 1400 # elif _MSC_VER < 1400
// Note: I'm not aware of any CE compiler with version 13xx
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown EVC++ compiler version - please run the configure tests and report the results"
# else
# pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results")
# endif
# elif _MSC_VER < 1500
# define BOOST_COMPILER_VERSION evc8 # define BOOST_COMPILER_VERSION evc8
# elif _MSC_VER == 1500 # elif _MSC_VER < 1600
# define BOOST_COMPILER_VERSION evc9 # define BOOST_COMPILER_VERSION evc9
# elif _MSC_VER == 1600 # elif _MSC_VER < 1700
# define BOOST_COMPILER_VERSION evc10 # define BOOST_COMPILER_VERSION evc10
# elif _MSC_VER < 1800
# define BOOST_COMPILER_VERSION evc11
# else # else
# if defined(BOOST_ASSERT_CONFIG) # if defined(BOOST_ASSERT_CONFIG)
# error "Unknown EVC++ compiler version - please run the configure tests and report the results" # error "Unknown EVC++ compiler version - please run the configure tests and report the results"
@ -207,32 +279,29 @@
# define BOOST_COMPILER_VERSION 5.0 # define BOOST_COMPILER_VERSION 5.0
# elif _MSC_VER < 1300 # elif _MSC_VER < 1300
# define BOOST_COMPILER_VERSION 6.0 # define BOOST_COMPILER_VERSION 6.0
# elif _MSC_VER == 1300 # elif _MSC_VER < 1310
# define BOOST_COMPILER_VERSION 7.0 # define BOOST_COMPILER_VERSION 7.0
# elif _MSC_VER == 1310 # elif _MSC_VER < 1400
# define BOOST_COMPILER_VERSION 7.1 # define BOOST_COMPILER_VERSION 7.1
# elif _MSC_VER == 1400 # elif _MSC_VER < 1500
# define BOOST_COMPILER_VERSION 8.0 # define BOOST_COMPILER_VERSION 8.0
# elif _MSC_VER == 1500 # elif _MSC_VER < 1600
# define BOOST_COMPILER_VERSION 9.0 # define BOOST_COMPILER_VERSION 9.0
# elif _MSC_VER == 1600 # elif _MSC_VER < 1700
# define BOOST_COMPILER_VERSION 10.0 # define BOOST_COMPILER_VERSION 10.0
# elif _MSC_VER < 1800
# define BOOST_COMPILER_VERSION 11.0
# else # else
# define BOOST_COMPILER_VERSION _MSC_VER # define BOOST_COMPILER_VERSION _MSC_VER
# endif # endif
# endif # endif
#define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION) # define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
#endif
// //
// versions check: // last known and checked version is 1700 (VC11, aka 2011):
// we don't support Visual C++ prior to version 6: #if (_MSC_VER > 1700)
#if _MSC_VER < 1200
#error "Compiler not supported or configured - please reconfigure"
#endif
//
// last known and checked version is 1500 (VC9):
#if (_MSC_VER > 1600)
# if defined(BOOST_ASSERT_CONFIG) # if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results" # error "Unknown compiler version - please run the configure tests and report the results"
# else # else

View File

@ -56,7 +56,7 @@
#endif #endif
#if !((defined(__FreeBSD__) && (__FreeBSD__ >= 5)) \ #if !((defined(__FreeBSD__) && (__FreeBSD__ >= 5)) \
|| (__NetBSD_GCC__ >= 2095003) || defined(__DragonFly__)) || (defined(__NetBSD_GCC__) && (__NetBSD_GCC__ >= 2095003)) || defined(__DragonFly__))
# define BOOST_NO_CWCHAR # define BOOST_NO_CWCHAR
#endif #endif
// //

View File

@ -8,9 +8,6 @@
// cygwin specific config options: // cygwin specific config options:
#define BOOST_PLATFORM "Cygwin" #define BOOST_PLATFORM "Cygwin"
#define BOOST_NO_CWCTYPE
#define BOOST_NO_CWCHAR
#define BOOST_NO_SWPRINTF
#define BOOST_HAS_DIRENT_H #define BOOST_HAS_DIRENT_H
#define BOOST_HAS_LOG1P #define BOOST_HAS_LOG1P
#define BOOST_HAS_EXPM1 #define BOOST_HAS_EXPM1
@ -42,8 +39,18 @@
#define BOOST_HAS_STDINT_H #define BOOST_HAS_STDINT_H
#endif #endif
/// Cygwin has no fenv.h
#define BOOST_NO_FENV_H
// boilerplate code: // boilerplate code:
#include <boost/config/posix_features.hpp> #include <boost/config/posix_features.hpp>
//
// Cygwin lies about XSI conformance, there is no nl_types.h:
//
#ifdef BOOST_HAS_NL_TYPES_H
# undef BOOST_HAS_NL_TYPES_H
#endif

View File

@ -11,7 +11,11 @@
#define BOOST_PLATFORM "linux" #define BOOST_PLATFORM "linux"
// make sure we have __GLIBC_PREREQ if available at all // make sure we have __GLIBC_PREREQ if available at all
#ifdef __cplusplus
#include <cstdlib> #include <cstdlib>
#else
#include <stdlib.h>
#endif
// //
// <stdint.h> added to glibc 2.1.1 // <stdint.h> added to glibc 2.1.1
@ -68,6 +72,7 @@
// boilerplate code: // boilerplate code:
#define BOOST_HAS_UNISTD_H #define BOOST_HAS_UNISTD_H
#include <boost/config/posix_features.hpp> #include <boost/config/posix_features.hpp>
#define BOOST_HAS_PTHREAD_YIELD
#ifndef __GNUC__ #ifndef __GNUC__
// //

View File

@ -64,16 +64,17 @@
# if ( defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON ) || ( defined(TARGET_CARBON) && TARGET_CARBON ) # if ( defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON ) || ( defined(TARGET_CARBON) && TARGET_CARBON )
# if !defined(BOOST_HAS_PTHREADS) # if !defined(BOOST_HAS_PTHREADS)
# define BOOST_HAS_MPTASKS // MPTasks support is deprecated/removed from Boost:
//# define BOOST_HAS_MPTASKS
# elif ( __dest_os == __mac_os_x ) # elif ( __dest_os == __mac_os_x )
// We are doing a Carbon/Mach-O/MSL build which has pthreads, but only the // We are doing a Carbon/Mach-O/MSL build which has pthreads, but only the
// gettimeofday and no posix. // gettimeofday and no posix.
# define BOOST_HAS_GETTIMEOFDAY # define BOOST_HAS_GETTIMEOFDAY
# endif # endif
// The MP task implementation of Boost Threads aims to replace MP-unsafe #ifdef BOOST_HAS_PTHREADS
// parts of the MSL, so we turn on threads unconditionally. # define BOOST_HAS_THREADS
# define BOOST_HAS_THREADS #endif
// The remote call manager depends on this. // The remote call manager depends on this.
# define BOOST_BIND_ENABLE_PASCAL # define BOOST_BIND_ENABLE_PASCAL

View File

@ -21,8 +21,14 @@
# define BOOST_NO_SWPRINTF # define BOOST_NO_SWPRINTF
#endif #endif
#if !defined(__GNUC__) && !defined(BOOST_HAS_DECLSPEC) // Default defines for BOOST_SYMBOL_EXPORT and BOOST_SYMBOL_IMPORT
// If a compiler doesn't support __declspec(dllexport)/__declspec(dllimport),
// its boost/config/compiler/ file must define BOOST_SYMBOL_EXPORT and
// BOOST_SYMBOL_IMPORT
#ifndef BOOST_SYMBOL_EXPORT
# define BOOST_HAS_DECLSPEC # define BOOST_HAS_DECLSPEC
# define BOOST_SYMBOL_EXPORT __declspec(dllexport)
# define BOOST_SYMBOL_IMPORT __declspec(dllimport)
#endif #endif
#if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0))) #if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0)))
@ -32,6 +38,11 @@
# define BOOST_HAS_UNISTD_H # define BOOST_HAS_UNISTD_H
#endif #endif
#if defined(__MINGW32__) && (__GNUC__ >= 4)
# define BOOST_HAS_EXPM1
# define BOOST_HAS_LOG1P
# define BOOST_HAS_GETTIMEOFDAY
#endif
// //
// Win32 will normally be using native Win32 threads, // Win32 will normally be using native Win32 threads,
// but there is a pthread library avaliable as an option, // but there is a pthread library avaliable as an option,
@ -44,6 +55,8 @@
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
# define BOOST_NO_ANSI_APIS # define BOOST_NO_ANSI_APIS
#else
# define BOOST_HAS_GETSYSTEMTIMEASFILETIME
#endif #endif
#ifndef BOOST_HAS_PTHREADS #ifndef BOOST_HAS_PTHREADS

View File

@ -10,29 +10,6 @@
// See http://www.boost.org/ for most recent version. // See http://www.boost.org/ for most recent version.
// one identification macro for each of the
// compilers we support:
# define BOOST_CXX_GCCXML 0
# define BOOST_CXX_COMO 0
# define BOOST_CXX_DMC 0
# define BOOST_CXX_INTEL 0
# define BOOST_CXX_GNUC 0
# define BOOST_CXX_KCC 0
# define BOOST_CXX_SGI 0
# define BOOST_CXX_TRU64 0
# define BOOST_CXX_GHS 0
# define BOOST_CXX_BORLAND 0
# define BOOST_CXX_CW 0
# define BOOST_CXX_SUNPRO 0
# define BOOST_CXX_HPACC 0
# define BOOST_CXX_MPW 0
# define BOOST_CXX_IBMCPP 0
# define BOOST_CXX_MSVC 0
# define BOOST_CXX_PGI 0
// locate which compiler we are using and define // locate which compiler we are using and define
// BOOST_COMPILER_CONFIG as needed: // BOOST_COMPILER_CONFIG as needed:
@ -40,10 +17,26 @@
// GCC-XML emulates other compilers, it has to appear first here! // GCC-XML emulates other compilers, it has to appear first here!
# define BOOST_COMPILER_CONFIG "boost/config/compiler/gcc_xml.hpp" # define BOOST_COMPILER_CONFIG "boost/config/compiler/gcc_xml.hpp"
#elif defined(_CRAYC)
// EDG based Cray compiler:
# define BOOST_COMPILER_CONFIG "boost/config/compiler/cray.hpp"
#elif defined __CUDACC__
// NVIDIA CUDA C++ compiler for GPU
# define BOOST_COMPILER_CONFIG "boost/config/compiler/nvcc.hpp"
#elif defined __COMO__ #elif defined __COMO__
// Comeau C++ // Comeau C++
# define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp" # define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp"
#elif defined(__PATHSCALE__) && (__PATHCC__ >= 4)
// PathScale EKOPath compiler (has to come before clang and gcc)
# define BOOST_COMPILER_CONFIG "boost/config/compiler/pathscale.hpp"
#elif defined __clang__
// Clang C++ emulates GCC, so it has to appear early.
# define BOOST_COMPILER_CONFIG "boost/config/compiler/clang.hpp"
#elif defined __DMC__ #elif defined __DMC__
// Digital Mars C++ // Digital Mars C++
# define BOOST_COMPILER_CONFIG "boost/config/compiler/digitalmars.hpp" # define BOOST_COMPILER_CONFIG "boost/config/compiler/digitalmars.hpp"

View File

@ -13,7 +13,7 @@
// <header_name> in order to prevent macro expansion within the header // <header_name> in order to prevent macro expansion within the header
// name (for example "linux" is a macro on linux systems). // name (for example "linux" is a macro on linux systems).
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) #if (defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(_CRAYC)
// linux, also other platforms (Hurd etc) that use GLIBC, should these really have their own config headers though? // linux, also other platforms (Hurd etc) that use GLIBC, should these really have their own config headers though?
# define BOOST_PLATFORM_CONFIG "boost/config/platform/linux.hpp" # define BOOST_PLATFORM_CONFIG "boost/config/platform/linux.hpp"
@ -61,6 +61,21 @@
// QNX: // QNX:
# define BOOST_PLATFORM_CONFIG "boost/config/platform/qnxnto.hpp" # define BOOST_PLATFORM_CONFIG "boost/config/platform/qnxnto.hpp"
#elif defined(__VXWORKS__)
// vxWorks:
# define BOOST_PLATFORM_CONFIG "boost/config/platform/vxworks.hpp"
#elif defined(__SYMBIAN32__)
// Symbian:
# define BOOST_PLATFORM_CONFIG "boost/config/platform/symbian.hpp"
#elif defined(_CRAYC)
// Cray:
# define BOOST_PLATFORM_CONFIG "boost/config/platform/cray.hpp"
#elif defined(__VMS)
// VMS:
# define BOOST_PLATFORM_CONFIG "boost/config/platform/vms.hpp"
#else #else
# if defined(unix) \ # if defined(unix) \

View File

@ -11,13 +11,14 @@
// locate which std lib we are using and define BOOST_STDLIB_CONFIG as needed: // locate which std lib we are using and define BOOST_STDLIB_CONFIG as needed:
// we need to include a std lib header here in order to detect which // First include <cstddef> to determine if some version of STLport is in use as the std lib
// library is in use, use <utility> as it's about the smallest // (do not rely on this header being included since users can short-circuit this header
// of the std lib headers - do not rely on this header being included - // if they know whose std lib they are using.)
// users can short-circuit this header if they know whose std lib #ifdef __cplusplus
// they are using. # include <cstddef>
#else
#include <boost/config/no_tr1/utility.hpp> # include <stddef.h>
#endif
#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
// STLPort library; this _must_ come first, otherwise since // STLPort library; this _must_ come first, otherwise since
@ -25,7 +26,17 @@
// can end up detecting that first rather than STLport: // can end up detecting that first rather than STLport:
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/stlport.hpp" # define BOOST_STDLIB_CONFIG "boost/config/stdlib/stlport.hpp"
#elif defined(__LIBCOMO__) #else
// If our std lib was not some version of STLport, then include <utility> as it is about
// the smallest of the std lib headers that includes real C++ stuff. (Some std libs do not
// include their C++-related macros in <cstddef> so this additional include makes sure
// we get those definitions)
// (again do not rely on this header being included since users can short-circuit this
// header if they know whose std lib they are using.)
#include <boost/config/no_tr1/utility.hpp>
#if defined(__LIBCOMO__)
// Comeau STL: // Comeau STL:
#define BOOST_STDLIB_CONFIG "boost/config/stdlib/libcomo.hpp" #define BOOST_STDLIB_CONFIG "boost/config/stdlib/libcomo.hpp"
@ -33,6 +44,10 @@
// Rogue Wave library: // Rogue Wave library:
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/roguewave.hpp" # define BOOST_STDLIB_CONFIG "boost/config/stdlib/roguewave.hpp"
#elif defined(_LIBCPP_VERSION)
// libc++
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/libcpp.hpp"
#elif defined(__GLIBCPP__) || defined(__GLIBCXX__) #elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
// GNU libstdc++ 3 // GNU libstdc++ 3
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/libstdcpp3.hpp" # define BOOST_STDLIB_CONFIG "boost/config/stdlib/libstdcpp3.hpp"
@ -64,5 +79,7 @@
#endif #endif
#endif

View File

@ -55,8 +55,10 @@
# define BOOST_HAS_MACRO_USE_FACET # define BOOST_HAS_MACRO_USE_FACET
# ifndef _CPPLIB_VER # ifndef _CPPLIB_VER
// Updated Dinkum library defines this, and provides // Updated Dinkum library defines this, and provides
// its own min and max definitions. // its own min and max definitions, as does MTA version.
# define BOOST_NO_STD_MIN_MAX # ifndef __MTA__
# define BOOST_NO_STD_MIN_MAX
# endif
# define BOOST_NO_MS_INT64_NUMERIC_LIMITS # define BOOST_NO_MS_INT64_NUMERIC_LIMITS
# endif # endif
#endif #endif
@ -78,17 +80,52 @@
# define BOOST_NO_STD_ITERATOR_TRAITS # define BOOST_NO_STD_ITERATOR_TRAITS
#endif #endif
//
// No std::unordered_* containers yet:
//
#define BOOST_NO_STD_UNORDERED
#if defined(__ICL) && (__ICL < 800) && defined(_CPPLIB_VER) && (_CPPLIB_VER <= 310) #if defined(__ICL) && (__ICL < 800) && defined(_CPPLIB_VER) && (_CPPLIB_VER <= 310)
// Intel C++ chokes over any non-trivial use of <locale> // Intel C++ chokes over any non-trivial use of <locale>
// this may be an overly restrictive define, but regex fails without it: // this may be an overly restrictive define, but regex fails without it:
# define BOOST_NO_STD_LOCALE # define BOOST_NO_STD_LOCALE
#endif #endif
#include <typeinfo>
#if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (!_HAS_NAMESPACE && defined(__ghs__)) )
# define BOOST_NO_STD_TYPEINFO
#endif
// C++0x headers implemented in 520 (as shipped by Microsoft)
//
#if !defined(_CPPLIB_VER) || _CPPLIB_VER < 520
# define BOOST_NO_CXX11_HDR_ARRAY
# define BOOST_NO_CXX11_HDR_CODECVT
# define BOOST_NO_CXX11_HDR_FORWARD_LIST
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
# define BOOST_NO_CXX11_HDR_RANDOM
# define BOOST_NO_CXX11_HDR_REGEX
# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
# define BOOST_NO_CXX11_HDR_UNORDERED_SET
# define BOOST_NO_CXX11_HDR_TUPLE
# define BOOST_NO_CXX11_HDR_TYPEINDEX
# define BOOST_NO_CXX11_HDR_FUNCTIONAL
# define BOOST_NO_CXX11_NUMERIC_LIMITS
# define BOOST_NO_CXX11_SMART_PTR
#endif
#if (!defined(_HAS_TR1_IMPORTS) || (_HAS_TR1_IMPORTS+0 == 0)) && !defined(BOOST_NO_CXX11_HDR_TUPLE)
# define BOOST_NO_CXX11_HDR_TUPLE
#endif
//
// C++0x headers not yet (fully) implemented:
//
# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
# define BOOST_NO_CXX11_HDR_CHRONO
# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
# define BOOST_NO_CXX11_HDR_FUTURE
# define BOOST_NO_CXX11_HDR_MUTEX
# define BOOST_NO_CXX11_HDR_RATIO
# define BOOST_NO_CXX11_HDR_THREAD
# define BOOST_NO_CXX11_ALLOCATOR
# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
#ifdef _CPPLIB_VER #ifdef _CPPLIB_VER
# define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER # define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER
#else #else

View File

@ -32,10 +32,32 @@
# define BOOST_HAS_HASH # define BOOST_HAS_HASH
# define BOOST_HAS_SLIST # define BOOST_HAS_SLIST
#endif #endif
// C++0x headers not yet implemented
// //
// We never have the new C++0x unordered containers: # define BOOST_NO_CXX11_HDR_ARRAY
// # define BOOST_NO_CXX11_HDR_CHRONO
#define BOOST_NO_STD_UNORDERED # define BOOST_NO_CXX11_HDR_CODECVT
# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
# define BOOST_NO_CXX11_HDR_FORWARD_LIST
# define BOOST_NO_CXX11_HDR_FUTURE
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
# define BOOST_NO_CXX11_HDR_MUTEX
# define BOOST_NO_CXX11_HDR_RANDOM
# define BOOST_NO_CXX11_HDR_RATIO
# define BOOST_NO_CXX11_HDR_REGEX
# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
# define BOOST_NO_CXX11_HDR_THREAD
# define BOOST_NO_CXX11_HDR_TUPLE
# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
# define BOOST_NO_CXX11_HDR_TYPEINDEX
# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
# define BOOST_NO_CXX11_HDR_UNORDERED_SET
# define BOOST_NO_CXX11_NUMERIC_LIMITS
# define BOOST_NO_CXX11_ALLOCATOR
# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
# define BOOST_NO_CXX11_SMART_PTR
# define BOOST_NO_CXX11_HDR_FUNCTIONAL
// //
// Intrinsic type_traits support. // Intrinsic type_traits support.

View File

@ -9,6 +9,8 @@
// config for libstdc++ v3 // config for libstdc++ v3
// not much to go in here: // not much to go in here:
#define BOOST_GNU_STDLIB 1
#ifdef __GLIBCXX__ #ifdef __GLIBCXX__
#define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCXX__) #define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCXX__)
#else #else
@ -31,7 +33,9 @@
#ifdef __GLIBCXX__ // gcc 3.4 and greater: #ifdef __GLIBCXX__ // gcc 3.4 and greater:
# if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \ # if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
|| defined(_GLIBCXX__PTHREADS) || defined(_GLIBCXX__PTHREADS) \
|| defined(_GLIBCXX_HAS_GTHREADS) \
|| defined(_WIN32)
// //
// If the std lib has thread support turned on, then turn it on in Boost // If the std lib has thread support turned on, then turn it on in Boost
// as well. We do this because some gcc-3.4 std lib headers define _REENTANT // as well. We do this because some gcc-3.4 std lib headers define _REENTANT
@ -54,7 +58,6 @@
# define BOOST_HAS_THREADS # define BOOST_HAS_THREADS
#endif #endif
#if !defined(_GLIBCPP_USE_LONG_LONG) \ #if !defined(_GLIBCPP_USE_LONG_LONG) \
&& !defined(_GLIBCXX_USE_LONG_LONG)\ && !defined(_GLIBCXX_USE_LONG_LONG)\
&& defined(BOOST_HAS_LONG_LONG) && defined(BOOST_HAS_LONG_LONG)
@ -63,6 +66,16 @@
# undef BOOST_HAS_LONG_LONG # undef BOOST_HAS_LONG_LONG
#endif #endif
// Apple doesn't seem to reliably defined a *unix* macro
#if !defined(CYGWIN) && ( defined(__unix__) \
|| defined(__unix) \
|| defined(unix) \
|| defined(__APPLE__) \
|| defined(__APPLE) \
|| defined(APPLE))
# include <unistd.h>
#endif
#if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0 #if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
# define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx # define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
# define BOOST_HAS_SLIST # define BOOST_HAS_SLIST
@ -77,7 +90,76 @@
# endif # endif
#endif #endif
#ifndef __GXX_EXPERIMENTAL_CXX0X__ // stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly
# define BOOST_NO_STD_UNORDERED // __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the stdlibc++
// developers. He also commented:
//
// "I'm not sure how useful __GLIBCXX__ is for your purposes, for instance in
// GCC 4.2.4 it is set to 20080519 but in GCC 4.3.0 it is set to 20080305.
// Although 4.3.0 was released earlier than 4.2.4, it has better C++0x support
// than any release in the 4.2 series."
//
// Another resource for understanding stdlibc++ features is:
// http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.standard.200x
// C++0x headers in GCC 4.3.0 and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
# define BOOST_NO_CXX11_HDR_ARRAY
# define BOOST_NO_CXX11_HDR_REGEX
# define BOOST_NO_CXX11_HDR_TUPLE
# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
# define BOOST_NO_CXX11_HDR_UNORDERED_SET
# define BOOST_NO_CXX11_HDR_FUNCTIONAL
#endif #endif
// C++0x headers in GCC 4.4.0 and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
# define BOOST_NO_CXX11_HDR_FORWARD_LIST
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
# define BOOST_NO_CXX11_HDR_MUTEX
# define BOOST_NO_CXX11_HDR_RATIO
# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
# define BOOST_NO_CXX11_SMART_PTR
#else
# define BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG
# define BOOST_HAS_TR1_COMPLEX_OVERLOADS
#endif
#if (!defined(_GLIBCXX_HAS_GTHREADS) || !defined(_GLIBCXX_USE_C99_STDINT_TR1)) && (!defined(BOOST_NO_CXX11_HDR_CONDITION_VARIABLE) || !defined(BOOST_NO_CXX11_HDR_MUTEX))
# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
# define BOOST_NO_CXX11_HDR_MUTEX
#endif
// C++0x features in GCC 4.5.0 and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
# define BOOST_NO_CXX11_NUMERIC_LIMITS
# define BOOST_NO_CXX11_HDR_FUTURE
# define BOOST_NO_CXX11_HDR_RANDOM
#endif
// C++0x features in GCC 4.6.0 and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
# define BOOST_NO_CXX11_HDR_TYPEINDEX
#endif
// C++0x features in GCC 4.7.0 and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
// Note that although <chrono> existed prior to 4.7, "stead_clock" is spelled "monotonic_clock"
// so 4.7.0 is the first truely conforming one.
# define BOOST_NO_CXX11_HDR_CHRONO
# define BOOST_NO_CXX11_ALLOCATOR
#endif
// C++0x headers not yet (fully!) implemented
//
# define BOOST_NO_CXX11_HDR_THREAD
# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
# define BOOST_NO_CXX11_HDR_CODECVT
# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
// --- end ---

View File

@ -21,10 +21,32 @@
#ifndef MSIPL_WCHART #ifndef MSIPL_WCHART
#define BOOST_NO_STD_WSTRING #define BOOST_NO_STD_WSTRING
#endif #endif
// C++0x headers not yet implemented
// //
// We never have the new C++0x unordered containers: # define BOOST_NO_CXX11_HDR_ARRAY
// # define BOOST_NO_CXX11_HDR_CHRONO
#define BOOST_NO_STD_UNORDERED # define BOOST_NO_CXX11_HDR_CODECVT
# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
# define BOOST_NO_CXX11_HDR_FORWARD_LIST
# define BOOST_NO_CXX11_HDR_FUTURE
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
# define BOOST_NO_CXX11_HDR_MUTEX
# define BOOST_NO_CXX11_HDR_RANDOM
# define BOOST_NO_CXX11_HDR_RATIO
# define BOOST_NO_CXX11_HDR_REGEX
# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
# define BOOST_NO_CXX11_HDR_THREAD
# define BOOST_NO_CXX11_HDR_TUPLE
# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
# define BOOST_NO_CXX11_HDR_TYPEINDEX
# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
# define BOOST_NO_CXX11_HDR_UNORDERED_SET
# define BOOST_NO_CXX11_NUMERIC_LIMITS
# define BOOST_NO_CXX11_ALLOCATOR
# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
# define BOOST_NO_CXX11_SMART_PTR
# define BOOST_NO_CXX11_HDR_FUNCTIONAL
#define BOOST_STDLIB "Modena C++ standard library" #define BOOST_STDLIB "Modena C++ standard library"

View File

@ -45,11 +45,32 @@
# define BOOST_NO_STD_USE_FACET # define BOOST_NO_STD_USE_FACET
# define BOOST_HAS_TWO_ARG_USE_FACET # define BOOST_HAS_TWO_ARG_USE_FACET
#endif #endif
//
// We never have the new C++0x unordered containers:
//
#define BOOST_NO_STD_UNORDERED
// C++0x headers not yet implemented
//
# define BOOST_NO_CXX11_HDR_ARRAY
# define BOOST_NO_CXX11_HDR_CHRONO
# define BOOST_NO_CXX11_HDR_CODECVT
# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
# define BOOST_NO_CXX11_HDR_FORWARD_LIST
# define BOOST_NO_CXX11_HDR_FUTURE
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
# define BOOST_NO_CXX11_HDR_MUTEX
# define BOOST_NO_CXX11_HDR_RANDOM
# define BOOST_NO_CXX11_HDR_RATIO
# define BOOST_NO_CXX11_HDR_REGEX
# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
# define BOOST_NO_CXX11_HDR_THREAD
# define BOOST_NO_CXX11_HDR_TUPLE
# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
# define BOOST_NO_CXX11_HDR_TYPEINDEX
# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
# define BOOST_NO_CXX11_HDR_UNORDERED_SET
# define BOOST_NO_CXX11_NUMERIC_LIMITS
# define BOOST_NO_CXX11_ALLOCATOR
# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
# define BOOST_NO_CXX11_SMART_PTR
# define BOOST_NO_CXX11_HDR_FUNCTIONAL
#define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__) #define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__)

View File

@ -10,6 +10,8 @@
// Rogue Wave std lib: // Rogue Wave std lib:
#define BOOST_RW_STDLIB 1
#if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER) #if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER)
# include <boost/config/no_tr1/utility.hpp> # include <boost/config/no_tr1/utility.hpp>
# if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER) # if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER)
@ -152,8 +154,33 @@
# endif # endif
#endif #endif
#if _RWSTD_VER < 0x05000000
# define BOOST_NO_CXX11_HDR_ARRAY
#endif
// type_traits header is incomplete:
# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
// //
// We never have the new C++0x unordered containers: // C++0x headers not yet implemented
// //
#define BOOST_NO_STD_UNORDERED # define BOOST_NO_CXX11_HDR_CHRONO
# define BOOST_NO_CXX11_HDR_CODECVT
# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
# define BOOST_NO_CXX11_HDR_FORWARD_LIST
# define BOOST_NO_CXX11_HDR_FUTURE
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
# define BOOST_NO_CXX11_HDR_MUTEX
# define BOOST_NO_CXX11_HDR_RANDOM
# define BOOST_NO_CXX11_HDR_RATIO
# define BOOST_NO_CXX11_HDR_REGEX
# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
# define BOOST_NO_CXX11_HDR_THREAD
# define BOOST_NO_CXX11_HDR_TUPLE
# define BOOST_NO_CXX11_HDR_TYPEINDEX
# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
# define BOOST_NO_CXX11_HDR_UNORDERED_SET
# define BOOST_NO_CXX11_NUMERIC_LIMITS
# define BOOST_NO_CXX11_ALLOCATOR
# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
# define BOOST_NO_CXX11_SMART_PTR
# define BOOST_NO_CXX11_HDR_FUNCTIONAL

View File

@ -40,6 +40,17 @@
# define BOOST_NO_STRINGSTREAM # define BOOST_NO_STRINGSTREAM
#endif #endif
// Apple doesn't seem to reliably defined a *unix* macro
#if !defined(CYGWIN) && ( defined(__unix__) \
|| defined(__unix) \
|| defined(unix) \
|| defined(__APPLE__) \
|| defined(__APPLE) \
|| defined(APPLE))
# include <unistd.h>
#endif
// //
// Assume no std::locale without own iostreams (this may be an // Assume no std::locale without own iostreams (this may be an
// incorrect assumption in some cases): // incorrect assumption in some cases):
@ -76,7 +87,6 @@
// //
#define BOOST_HAS_HASH #define BOOST_HAS_HASH
#define BOOST_HAS_SLIST #define BOOST_HAS_SLIST
#define BOOST_NO_STD_UNORDERED
// //
// If this is GNU libstdc++2, then no <limits> and no std::wstring: // If this is GNU libstdc++2, then no <limits> and no std::wstring:
@ -106,6 +116,32 @@
// //
#define BOOST_HAS_SGI_TYPE_TRAITS #define BOOST_HAS_SGI_TYPE_TRAITS
// C++0x headers not yet implemented
//
# define BOOST_NO_CXX11_HDR_ARRAY
# define BOOST_NO_CXX11_HDR_CHRONO
# define BOOST_NO_CXX11_HDR_CODECVT
# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
# define BOOST_NO_CXX11_HDR_FORWARD_LIST
# define BOOST_NO_CXX11_HDR_FUTURE
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
# define BOOST_NO_CXX11_HDR_MUTEX
# define BOOST_NO_CXX11_HDR_RANDOM
# define BOOST_NO_CXX11_HDR_RATIO
# define BOOST_NO_CXX11_HDR_REGEX
# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
# define BOOST_NO_CXX11_HDR_THREAD
# define BOOST_NO_CXX11_HDR_TUPLE
# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
# define BOOST_NO_CXX11_HDR_TYPEINDEX
# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
# define BOOST_NO_CXX11_HDR_UNORDERED_SET
# define BOOST_NO_CXX11_NUMERIC_LIMITS
# define BOOST_NO_CXX11_ALLOCATOR
# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
# define BOOST_NO_CXX11_SMART_PTR
# define BOOST_NO_CXX11_HDR_FUNCTIONAL
#define BOOST_STDLIB "SGI standard library" #define BOOST_STDLIB "SGI standard library"

View File

@ -16,6 +16,16 @@
# endif # endif
#endif #endif
// Apple doesn't seem to reliably defined a *unix* macro
#if !defined(CYGWIN) && ( defined(__unix__) \
|| defined(__unix) \
|| defined(unix) \
|| defined(__APPLE__) \
|| defined(__APPLE) \
|| defined(APPLE))
# include <unistd.h>
#endif
// //
// __STL_STATIC_CONST_INIT_BUG implies BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS // __STL_STATIC_CONST_INIT_BUG implies BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
// for versions prior to 4.1(beta) // for versions prior to 4.1(beta)
@ -61,8 +71,9 @@
# endif # endif
#endif #endif
#if defined(_STLPORT_VERSION) && (_STLPORT_VERSION < 0x500) #if defined(_STLPORT_VERSION) && (_STLPORT_VERSION >= 0x520)
# define BOOST_NO_STD_UNORDERED # define BOOST_HAS_TR1_UNORDERED_SET
# define BOOST_HAS_TR1_UNORDERED_MAP
#endif #endif
// //
// Without member template support enabled, their are no template // Without member template support enabled, their are no template
@ -195,6 +206,32 @@ namespace std{ using _STLP_VENDOR_CSTD::strcmp; using _STLP_VENDOR_CSTD::strcpy;
namespace boost { using std::min; using std::max; } namespace boost { using std::min; using std::max; }
#endif #endif
// C++0x headers not yet implemented
//
# define BOOST_NO_CXX11_HDR_ARRAY
# define BOOST_NO_CXX11_HDR_CHRONO
# define BOOST_NO_CXX11_HDR_CODECVT
# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
# define BOOST_NO_CXX11_HDR_FORWARD_LIST
# define BOOST_NO_CXX11_HDR_FUTURE
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
# define BOOST_NO_CXX11_HDR_MUTEX
# define BOOST_NO_CXX11_HDR_RANDOM
# define BOOST_NO_CXX11_HDR_RATIO
# define BOOST_NO_CXX11_HDR_REGEX
# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
# define BOOST_NO_CXX11_HDR_THREAD
# define BOOST_NO_CXX11_HDR_TUPLE
# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
# define BOOST_NO_CXX11_HDR_TYPEINDEX
# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
# define BOOST_NO_CXX11_HDR_UNORDERED_SET
# define BOOST_NO_CXX11_NUMERIC_LIMITS
# define BOOST_NO_CXX11_ALLOCATOR
# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
# define BOOST_NO_CXX11_SMART_PTR
# define BOOST_NO_CXX11_HDR_FUNCTIONAL
#define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT) #define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT)

View File

@ -11,7 +11,42 @@
#define BOOST_HAS_MACRO_USE_FACET #define BOOST_HAS_MACRO_USE_FACET
#define BOOST_NO_STD_MESSAGES #define BOOST_NO_STD_MESSAGES
#define BOOST_NO_STD_UNORDERED
// Apple doesn't seem to reliably defined a *unix* macro
#if !defined(CYGWIN) && ( defined(__unix__) \
|| defined(__unix) \
|| defined(unix) \
|| defined(__APPLE__) \
|| defined(__APPLE) \
|| defined(APPLE))
# include <unistd.h>
#endif
// C++0x headers not yet implemented
//
# define BOOST_NO_CXX11_HDR_ARRAY
# define BOOST_NO_CXX11_HDR_CHRONO
# define BOOST_NO_CXX11_HDR_CODECVT
# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
# define BOOST_NO_CXX11_HDR_FORWARD_LIST
# define BOOST_NO_CXX11_HDR_FUTURE
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
# define BOOST_NO_CXX11_HDR_MUTEX
# define BOOST_NO_CXX11_HDR_RANDOM
# define BOOST_NO_CXX11_HDR_RATIO
# define BOOST_NO_CXX11_HDR_REGEX
# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
# define BOOST_NO_CXX11_HDR_THREAD
# define BOOST_NO_CXX11_HDR_TUPLE
# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
# define BOOST_NO_CXX11_HDR_TYPEINDEX
# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
# define BOOST_NO_CXX11_HDR_UNORDERED_SET
# define BOOST_NO_CXX11_NUMERIC_LIMITS
# define BOOST_NO_CXX11_ALLOCATOR
# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
# define BOOST_NO_CXX11_SMART_PTR
# define BOOST_NO_CXX11_HDR_FUNCTIONAL
#define BOOST_STDLIB "Visual Age default standard library" #define BOOST_STDLIB "Visual Age default standard library"

View File

@ -8,7 +8,7 @@
// Copyright (c) 2002-2003 David Abrahams // Copyright (c) 2002-2003 David Abrahams
// Copyright (c) 2003 Gennaro Prota // Copyright (c) 2003 Gennaro Prota
// Copyright (c) 2003 Eric Friedman // Copyright (c) 2003 Eric Friedman
// // Copyright (c) 2010 Eric Jourdanneau, Joel Falcou
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at // 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)
@ -25,6 +25,27 @@
#ifndef BOOST_CONFIG_SUFFIX_HPP #ifndef BOOST_CONFIG_SUFFIX_HPP
#define BOOST_CONFIG_SUFFIX_HPP #define BOOST_CONFIG_SUFFIX_HPP
#if defined(__GNUC__) && (__GNUC__ >= 4)
//
// Some GCC-4.x versions issue warnings even when __extension__ is used,
// so use this as a workaround:
//
#pragma GCC system_header
#endif
//
// ensure that visibility macros are always defined, thus symplifying use
//
#ifndef BOOST_SYMBOL_EXPORT
# define BOOST_SYMBOL_EXPORT
#endif
#ifndef BOOST_SYMBOL_IMPORT
# define BOOST_SYMBOL_IMPORT
#endif
#ifndef BOOST_SYMBOL_VISIBLE
# define BOOST_SYMBOL_VISIBLE
#endif
// //
// look for long long by looking for the appropriate macros in <limits.h>. // look for long long by looking for the appropriate macros in <limits.h>.
// Note that we use limits.h rather than climits for maximal portability, // Note that we use limits.h rather than climits for maximal portability,
@ -326,7 +347,7 @@
// works as expected with standard conforming compilers. The resulting // works as expected with standard conforming compilers. The resulting
// double inclusion of <cstddef> is harmless. // double inclusion of <cstddef> is harmless.
# ifdef BOOST_NO_STDC_NAMESPACE # if defined(BOOST_NO_STDC_NAMESPACE) && defined(__cplusplus)
# include <cstddef> # include <cstddef>
namespace std { using ::ptrdiff_t; using ::size_t; } namespace std { using ::ptrdiff_t; using ::size_t; }
# endif # endif
@ -345,7 +366,7 @@
// BOOST_NO_STD_MIN_MAX workaround -----------------------------------------// // BOOST_NO_STD_MIN_MAX workaround -----------------------------------------//
# ifdef BOOST_NO_STD_MIN_MAX # if defined(BOOST_NO_STD_MIN_MAX) && defined(__cplusplus)
namespace std { namespace std {
template <class _Tp> template <class _Tp>
@ -456,7 +477,7 @@ namespace std {
// but it's use may generate either warnings (with -ansi), or errors // but it's use may generate either warnings (with -ansi), or errors
// (with -pedantic -ansi) unless it's use is prefixed by __extension__ // (with -pedantic -ansi) unless it's use is prefixed by __extension__
// //
#if defined(BOOST_HAS_LONG_LONG) #if defined(BOOST_HAS_LONG_LONG) && defined(__cplusplus)
namespace boost{ namespace boost{
# ifdef __GNUC__ # ifdef __GNUC__
__extension__ typedef long long long_long_type; __extension__ typedef long long long_long_type;
@ -510,7 +531,7 @@ namespace boost{
// //
#if defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS #if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) && defined(__cplusplus)
# include "boost/type.hpp" # include "boost/type.hpp"
# include "boost/non_type.hpp" # include "boost/non_type.hpp"
@ -546,6 +567,12 @@ namespace boost{
#endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS #endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
// When BOOST_NO_STD_TYPEINFO is defined, we can just import
// the global definition into std namespace:
#if defined(BOOST_NO_STD_TYPEINFO) && defined(__cplusplus)
#include <typeinfo>
namespace std{ using ::type_info; }
#endif
// ---------------------------------------------------------------------------// // ---------------------------------------------------------------------------//
@ -588,6 +615,293 @@ namespace boost{
# endif # endif
# endif # endif
//
// Set some default values GPU support
//
# ifndef BOOST_GPU_ENABLED
# define BOOST_GPU_ENABLED
# endif
// BOOST_FORCEINLINE ---------------------------------------------//
// Macro to use in place of 'inline' to force a function to be inline
#if !defined(BOOST_FORCEINLINE)
# if defined(_MSC_VER)
# define BOOST_FORCEINLINE __forceinline
# elif defined(__GNUC__) && __GNUC__ > 3
# define BOOST_FORCEINLINE inline __attribute__ ((always_inline))
# else
# define BOOST_FORCEINLINE inline
# endif
#endif
//
// Set BOOST_NO_DECLTYPE_N3276 when BOOST_NO_DECLTYPE is defined
//
#if defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_DECLTYPE_N3276)
#define BOOST_NO_CXX11_DECLTYPE_N3276 BOOST_NO_CXX11_DECLTYPE
#endif
// -------------------- Deprecated macros for 1.50 ---------------------------
// These will go away in a future release
// Use BOOST_NO_CXX11_HDR_UNORDERED_SET or BOOST_NO_CXX11_HDR_UNORDERED_MAP
// instead of BOOST_NO_STD_UNORDERED
#if defined(BOOST_NO_CXX11_HDR_UNORDERED_MAP) || defined (BOOST_NO_CXX11_HDR_UNORDERED_SET)
# ifndef BOOST_NO_STD_UNORDERED
# define BOOST_NO_STD_UNORDERED
# endif
#endif
// Use BOOST_NO_CXX11_HDR_INITIALIZER_LIST instead of BOOST_NO_INITIALIZER_LISTS
#if defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) && !defined(BOOST_NO_INITIALIZER_LISTS)
# define BOOST_NO_INITIALIZER_LISTS
#endif
// Use BOOST_NO_CXX11_HDR_ARRAY instead of BOOST_NO_0X_HDR_ARRAY
#if defined(BOOST_NO_CXX11_HDR_ARRAY) && !defined(BOOST_NO_BOOST_NO_0X_HDR_ARRAY)
# define BOOST_NO_0X_HDR_ARRAY
#endif
// Use BOOST_NO_CXX11_HDR_CHRONO instead of BOOST_NO_0X_HDR_CHRONO
#if defined(BOOST_NO_CXX11_HDR_CHRONO) && !defined(BOOST_NO_0X_HDR_CHRONO)
# define BOOST_NO_0X_HDR_CHRONO
#endif
// Use BOOST_NO_CXX11_HDR_CODECVT instead of BOOST_NO_0X_HDR_CODECVT
#if defined(BOOST_NO_CXX11_HDR_CODECVT) && !defined(BOOST_NO_0X_HDR_CODECVT)
# define BOOST_NO_0X_HDR_CODECVT
#endif
// Use BOOST_NO_CXX11_HDR_CONDITION_VARIABLE instead of BOOST_NO_0X_HDR_CONDITION_VARIABLE
#if defined(BOOST_NO_CXX11_HDR_CONDITION_VARIABLE) && !defined(BOOST_NO_0X_HDR_CONDITION_VARIABLE)
# define BOOST_NO_0X_HDR_CONDITION_VARIABLE
#endif
// Use BOOST_NO_CXX11_HDR_FORWARD_LIST instead of BOOST_NO_0X_HDR_FORWARD_LIST
#if defined(BOOST_NO_CXX11_HDR_FORWARD_LIST) && !defined(BOOST_NO_0X_HDR_FORWARD_LIST)
# define BOOST_NO_0X_HDR_FORWARD_LIST
#endif
// Use BOOST_NO_CXX11_HDR_FUTURE instead of BOOST_NO_0X_HDR_FUTURE
#if defined(BOOST_NO_CXX11_HDR_FUTURE) && !defined(BOOST_NO_0X_HDR_FUTURE)
# define BOOST_NO_0X_HDR_FUTURE
#endif
// Use BOOST_NO_CXX11_HDR_INITIALIZER_LIST
// instead of BOOST_NO_0X_HDR_INITIALIZER_LIST or BOOST_NO_INITIALIZER_LISTS
#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
# ifndef BOOST_NO_0X_HDR_INITIALIZER_LIST
# define BOOST_NO_0X_HDR_INITIALIZER_LIST
# endif
# ifndef BOOST_NO_INITIALIZER_LISTS
# define BOOST_NO_INITIALIZER_LISTS
# endif
#endif
// Use BOOST_NO_CXX11_HDR_MUTEX instead of BOOST_NO_0X_HDR_MUTEX
#if defined(BOOST_NO_CXX11_HDR_MUTEX) && !defined(BOOST_NO_0X_HDR_MUTEX)
# define BOOST_NO_0X_HDR_MUTEX
#endif
// Use BOOST_NO_CXX11_HDR_RANDOM instead of BOOST_NO_0X_HDR_RANDOM
#if defined(BOOST_NO_CXX11_HDR_RANDOM) && !defined(BOOST_NO_0X_HDR_RANDOM)
# define BOOST_NO_0X_HDR_RANDOM
#endif
// Use BOOST_NO_CXX11_HDR_RATIO instead of BOOST_NO_0X_HDR_RATIO
#if defined(BOOST_NO_CXX11_HDR_RATIO) && !defined(BOOST_NO_0X_HDR_RATIO)
# define BOOST_NO_0X_HDR_RATIO
#endif
// Use BOOST_NO_CXX11_HDR_REGEX instead of BOOST_NO_0X_HDR_REGEX
#if defined(BOOST_NO_CXX11_HDR_REGEX) && !defined(BOOST_NO_0X_HDR_REGEX)
# define BOOST_NO_0X_HDR_REGEX
#endif
// Use BOOST_NO_CXX11_HDR_SYSTEM_ERROR instead of BOOST_NO_0X_HDR_SYSTEM_ERROR
#if defined(BOOST_NO_CXX11_HDR_SYSTEM_ERROR) && !defined(BOOST_NO_0X_HDR_SYSTEM_ERROR)
# define BOOST_NO_0X_HDR_SYSTEM_ERROR
#endif
// Use BOOST_NO_CXX11_HDR_THREAD instead of BOOST_NO_0X_HDR_THREAD
#if defined(BOOST_NO_CXX11_HDR_THREAD) && !defined(BOOST_NO_0X_HDR_THREAD)
# define BOOST_NO_0X_HDR_THREAD
#endif
// Use BOOST_NO_CXX11_HDR_TUPLE instead of BOOST_NO_0X_HDR_TUPLE
#if defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_0X_HDR_TUPLE)
# define BOOST_NO_0X_HDR_TUPLE
#endif
// Use BOOST_NO_CXX11_HDR_TYPE_TRAITS instead of BOOST_NO_0X_HDR_TYPE_TRAITS
#if defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) && !defined(BOOST_NO_0X_HDR_TYPE_TRAITS)
# define BOOST_NO_0X_HDR_TYPE_TRAITS
#endif
// Use BOOST_NO_CXX11_HDR_TYPEINDEX instead of BOOST_NO_0X_HDR_TYPEINDEX
#if defined(BOOST_NO_CXX11_HDR_TYPEINDEX) && !defined(BOOST_NO_0X_HDR_TYPEINDEX)
# define BOOST_NO_0X_HDR_TYPEINDEX
#endif
// Use BOOST_NO_CXX11_HDR_UNORDERED_MAP instead of BOOST_NO_0X_HDR_UNORDERED_MAP
#if defined(BOOST_NO_CXX11_HDR_UNORDERED_MAP) && !defined(BOOST_NO_0X_HDR_UNORDERED_MAP)
# define BOOST_NO_0X_HDR_UNORDERED_MAP
#endif
// Use BOOST_NO_CXX11_HDR_UNORDERED_SET instead of BOOST_NO_0X_HDR_UNORDERED_SET
#if defined(BOOST_NO_CXX11_HDR_UNORDERED_SET) && !defined(BOOST_NO_0X_HDR_UNORDERED_SET)
# define BOOST_NO_0X_HDR_UNORDERED_SET
#endif
// ------------------ End of deprecated macros for 1.50 ---------------------------
// -------------------- Deprecated macros for 1.51 ---------------------------
// These will go away in a future release
// Use BOOST_NO_CXX11_AUTO_DECLARATIONS instead of BOOST_NO_AUTO_DECLARATIONS
#if defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && !defined(BOOST_NO_AUTO_DECLARATIONS)
# define BOOST_NO_AUTO_DECLARATIONS
#endif
// Use BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS instead of BOOST_NO_AUTO_MULTIDECLARATIONS
#if defined(BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS) && !defined(BOOST_NO_AUTO_MULTIDECLARATIONS)
# define BOOST_NO_AUTO_MULTIDECLARATIONS
#endif
// Use BOOST_NO_CXX11_CHAR16_T instead of BOOST_NO_CHAR16_T
#if defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CHAR16_T)
# define BOOST_NO_CHAR16_T
#endif
// Use BOOST_NO_CXX11_CHAR32_T instead of BOOST_NO_CHAR32_T
#if defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CHAR32_T)
# define BOOST_NO_CHAR32_T
#endif
// Use BOOST_NO_CXX11_TEMPLATE_ALIASES instead of BOOST_NO_TEMPLATE_ALIASES
#if defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_TEMPLATE_ALIASES)
# define BOOST_NO_TEMPLATE_ALIASES
#endif
// Use BOOST_NO_CXX11_CONSTEXPR instead of BOOST_NO_CONSTEXPR
#if defined(BOOST_NO_CXX11_CONSTEXPR) && !defined(BOOST_NO_CONSTEXPR)
# define BOOST_NO_CONSTEXPR
#endif
// Use BOOST_NO_CXX11_DECLTYPE_N3276 instead of BOOST_NO_DECLTYPE_N3276
#if defined(BOOST_NO_CXX11_DECLTYPE_N3276) && !defined(BOOST_NO_DECLTYPE_N3276)
# define BOOST_NO_DECLTYPE_N3276
#endif
// Use BOOST_NO_CXX11_DECLTYPE instead of BOOST_NO_DECLTYPE
#if defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_DECLTYPE)
# define BOOST_NO_DECLTYPE
#endif
// Use BOOST_NO_CXX11_DEFAULTED_FUNCTIONS instead of BOOST_NO_DEFAULTED_FUNCTIONS
#if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(BOOST_NO_DEFAULTED_FUNCTIONS)
# define BOOST_NO_DEFAULTED_FUNCTIONS
#endif
// Use BOOST_NO_CXX11_DELETED_FUNCTIONS instead of BOOST_NO_DELETED_FUNCTIONS
#if defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) && !defined(BOOST_NO_DELETED_FUNCTIONS)
# define BOOST_NO_DELETED_FUNCTIONS
#endif
// Use BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS instead of BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#if defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) && !defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#endif
// Use BOOST_NO_CXX11_EXTERN_TEMPLATE instead of BOOST_NO_EXTERN_TEMPLATE
#if defined(BOOST_NO_CXX11_EXTERN_TEMPLATE) && !defined(BOOST_NO_EXTERN_TEMPLATE)
# define BOOST_NO_EXTERN_TEMPLATE
#endif
// Use BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS instead of BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#if defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && !defined(BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS)
# define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#endif
// Use BOOST_NO_CXX11_LAMBDAS instead of BOOST_NO_LAMBDAS
#if defined(BOOST_NO_CXX11_LAMBDAS) && !defined(BOOST_NO_LAMBDAS)
# define BOOST_NO_LAMBDAS
#endif
// Use BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS instead of BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS
#if defined(BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS) && !defined(BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS)
# define BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS
#endif
// Use BOOST_NO_CXX11_NOEXCEPT instead of BOOST_NO_NOEXCEPT
#if defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_NOEXCEPT)
# define BOOST_NO_NOEXCEPT
#endif
// Use BOOST_NO_CXX11_NULLPTR instead of BOOST_NO_NULLPTR
#if defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR)
# define BOOST_NO_NULLPTR
#endif
// Use BOOST_NO_CXX11_RAW_LITERALS instead of BOOST_NO_RAW_LITERALS
#if defined(BOOST_NO_CXX11_RAW_LITERALS) && !defined(BOOST_NO_RAW_LITERALS)
# define BOOST_NO_RAW_LITERALS
#endif
// Use BOOST_NO_CXX11_RVALUE_REFERENCES instead of BOOST_NO_RVALUE_REFERENCES
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_RVALUE_REFERENCES)
# define BOOST_NO_RVALUE_REFERENCES
#endif
// Use BOOST_NO_CXX11_SCOPED_ENUMS instead of BOOST_NO_SCOPED_ENUMS
#if defined(BOOST_NO_CXX11_SCOPED_ENUMS) && !defined(BOOST_NO_SCOPED_ENUMS)
# define BOOST_NO_SCOPED_ENUMS
#endif
// Use BOOST_NO_CXX11_STATIC_ASSERT instead of BOOST_NO_STATIC_ASSERT
#if defined(BOOST_NO_CXX11_STATIC_ASSERT) && !defined(BOOST_NO_STATIC_ASSERT)
# define BOOST_NO_STATIC_ASSERT
#endif
// Use BOOST_NO_CXX11_STD_UNORDERD instead of BOOST_NO_STD_UNORDERD
#if defined(BOOST_NO_CXX11_STD_UNORDERD) && !defined(BOOST_NO_STD_UNORDERD)
# define BOOST_NO_STD_UNORDERD
#endif
// Use BOOST_NO_CXX11_UNICODE_LITERALS instead of BOOST_NO_UNICODE_LITERALS
#if defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(BOOST_NO_UNICODE_LITERALS)
# define BOOST_NO_UNICODE_LITERALS
#endif
// Use BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX instead of BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
#if defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !defined(BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX)
# define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
#endif
// Use BOOST_NO_CXX11_VARIADIC_TEMPLATES instead of BOOST_NO_VARIADIC_TEMPLATES
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_VARIADIC_TEMPLATES)
# define BOOST_NO_VARIADIC_TEMPLATES
#endif
// Use BOOST_NO_CXX11_VARIADIC_MACROS instead of BOOST_NO_VARIADIC_MACROS
#if defined(BOOST_NO_CXX11_VARIADIC_MACROS) && !defined(BOOST_NO_VARIADIC_MACROS)
# define BOOST_NO_VARIADIC_MACROS
#endif
// Use BOOST_NO_CXX11_NUMERIC_LIMITS instead of BOOST_NO_NUMERIC_LIMITS_LOWEST
#if defined(BOOST_NO_CXX11_NUMERIC_LIMITS) && !defined(BOOST_NO_NUMERIC_LIMITS_LOWEST)
# define BOOST_NO_NUMERIC_LIMITS_LOWEST
#endif
// ------------------ End of deprecated macros for 1.51 ---------------------------
//
// Helper macros BOOST_NOEXCEPT, BOOST_NOEXCEPT_IF, BOOST_NOEXCEPT_EXPR
// These aid the transition to C++11 while still supporting C++03 compilers
//
#ifdef BOOST_NO_NOEXCEPT
# define BOOST_NOEXCEPT
# define BOOST_NOEXCEPT_IF(Predicate)
# define BOOST_NOEXCEPT_EXPR(Expression) false
#else
# define BOOST_NOEXCEPT noexcept
# define BOOST_NOEXCEPT_IF(Predicate) noexcept((Predicate))
# define BOOST_NOEXCEPT_EXPR(Expression) noexcept((Expression))
#endif
//
// Normalize BOOST_NO_STATIC_ASSERT and (depricated) BOOST_HAS_STATIC_ASSERT:
//
#if !defined(BOOST_NO_STATIC_ASSERT) && !defined(BOOST_HAS_STATIC_ASSERT)
# define BOOST_HAS_STATIC_ASSERT
#endif
//
// constexpr workarounds
//
#if defined(BOOST_NO_CONSTEXPR)
#define BOOST_CONSTEXPR
#define BOOST_CONSTEXPR_OR_CONST const
#else
#define BOOST_CONSTEXPR constexpr
#define BOOST_CONSTEXPR_OR_CONST constexpr
#endif
#define BOOST_STATIC_CONSTEXPR static BOOST_CONSTEXPR_OR_CONST
//
// Set BOOST_HAS_RVALUE_REFS when BOOST_NO_RVALUE_REFERENCES is not defined
//
#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_HAS_RVALUE_REFS)
#define BOOST_HAS_RVALUE_REFS
#endif
//
// Set BOOST_HAS_VARIADIC_TMPL when BOOST_NO_VARIADIC_TEMPLATES is not defined
//
#if !defined(BOOST_NO_VARIADIC_TEMPLATES) && !defined(BOOST_HAS_VARIADIC_TMPL)
#define BOOST_HAS_VARIADIC_TMPL
#endif #endif
#endif

View File

@ -23,7 +23,7 @@
// Note that THIS HEADER MUST NOT INCLUDE ANY OTHER HEADERS: // Note that THIS HEADER MUST NOT INCLUDE ANY OTHER HEADERS:
// not even std library ones! Doing so may turn the warning // not even std library ones! Doing so may turn the warning
// off too late to be of any use. For example the VC++ C4996 // off too late to be of any use. For example the VC++ C4996
// warning can be omitted from <iosfwd> if that header is included // warning can be emitted from <iosfwd> if that header is included
// before or by this one :-( // before or by this one :-(
// //

View File

@ -23,10 +23,25 @@
#ifndef BOOST_CSTDINT_HPP #ifndef BOOST_CSTDINT_HPP
#define BOOST_CSTDINT_HPP #define BOOST_CSTDINT_HPP
//
// Since we always define the INT#_C macros as per C++0x,
// define __STDC_CONSTANT_MACROS so that <stdint.h> does the right
// thing if possible, and so that the user knows that the macros
// are actually defined as per C99.
//
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif
#include <boost/config.hpp> #include <boost/config.hpp>
//
#ifdef BOOST_HAS_STDINT_H // Note that GLIBC is a bit inconsistent about whether int64_t is defined or not
// depending upon what headers happen to have been included first...
// so we disable use of stdint.h when GLIBC does not define __GLIBC_HAVE_LONG_LONG.
// See https://svn.boost.org/trac/boost/ticket/3548 and http://sources.redhat.com/bugzilla/show_bug.cgi?id=10990
//
#if defined(BOOST_HAS_STDINT_H) && (!defined(__GLIBC__) || defined(__GLIBC_HAVE_LONG_LONG))
// The following #include is an implementation artifact; not part of interface. // The following #include is an implementation artifact; not part of interface.
# ifdef __hpux # ifdef __hpux
@ -122,7 +137,7 @@ namespace boost
} // namespace boost } // namespace boost
#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) #elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) || defined(__VMS)
// FreeBSD and Tru64 have an <inttypes.h> that contains much of what we need. // FreeBSD and Tru64 have an <inttypes.h> that contains much of what we need.
# include <inttypes.h> # include <inttypes.h>
@ -220,6 +235,15 @@ namespace boost
typedef unsigned short uint_least16_t; typedef unsigned short uint_least16_t;
typedef unsigned short uint_fast16_t; typedef unsigned short uint_fast16_t;
# endif # endif
# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__)
// On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified
// MTA / XMT does support the following non-standard integer types
typedef __short16 int16_t;
typedef __short16 int_least16_t;
typedef __short16 int_fast16_t;
typedef unsigned __short16 uint16_t;
typedef unsigned __short16 uint_least16_t;
typedef unsigned __short16 uint_fast16_t;
# elif (USHRT_MAX == 0xffffffff) && defined(CRAY) # elif (USHRT_MAX == 0xffffffff) && defined(CRAY)
// no 16-bit types on Cray: // no 16-bit types on Cray:
typedef short int_least16_t; typedef short int_least16_t;
@ -232,20 +256,35 @@ namespace boost
// 32-bit types -----------------------------------------------------------// // 32-bit types -----------------------------------------------------------//
# if ULONG_MAX == 0xffffffff # if UINT_MAX == 0xffffffff
typedef long int32_t;
typedef long int_least32_t;
typedef long int_fast32_t;
typedef unsigned long uint32_t;
typedef unsigned long uint_least32_t;
typedef unsigned long uint_fast32_t;
# elif UINT_MAX == 0xffffffff
typedef int int32_t; typedef int int32_t;
typedef int int_least32_t; typedef int int_least32_t;
typedef int int_fast32_t; typedef int int_fast32_t;
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
typedef unsigned int uint_least32_t; typedef unsigned int uint_least32_t;
typedef unsigned int uint_fast32_t; typedef unsigned int uint_fast32_t;
# elif (USHRT_MAX == 0xffffffff)
typedef short int32_t;
typedef short int_least32_t;
typedef short int_fast32_t;
typedef unsigned short uint32_t;
typedef unsigned short uint_least32_t;
typedef unsigned short uint_fast32_t;
# elif ULONG_MAX == 0xffffffff
typedef long int32_t;
typedef long int_least32_t;
typedef long int_fast32_t;
typedef unsigned long uint32_t;
typedef unsigned long uint_least32_t;
typedef unsigned long uint_fast32_t;
# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__)
// Integers are 64 bits on the MTA / XMT
typedef __int32 int32_t;
typedef __int32 int_least32_t;
typedef __int32 int_fast32_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int32 uint_least32_t;
typedef unsigned __int32 uint_fast32_t;
# else # else
# error defaults not correct; you must hand modify boost/cstdint.hpp # error defaults not correct; you must hand modify boost/cstdint.hpp
# endif # endif
@ -326,91 +365,130 @@ namespace boost
Macro definition section: Macro definition section:
Define various INTXX_C macros only if
__STDC_CONSTANT_MACROS is defined.
Undefine the macros if __STDC_CONSTANT_MACROS is
not defined and the macros are (cf <cassert>).
Added 23rd September 2000 (John Maddock). Added 23rd September 2000 (John Maddock).
Modified 11th September 2001 to be excluded when Modified 11th September 2001 to be excluded when
BOOST_HAS_STDINT_H is defined (John Maddock). BOOST_HAS_STDINT_H is defined (John Maddock).
Modified 11th Dec 2009 to always define the
INT#_C macros if they're not already defined (John Maddock).
******************************************************/ ******************************************************/
#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(BOOST_HAS_STDINT_H) #if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && \
(!defined(INT8_C) || !defined(INT16_C) || !defined(INT32_C) || !defined(INT64_C))
//
// For the following code we get several warnings along the lines of:
//
// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant
//
// So we declare this a system header to suppress these warnings.
//
#if defined(__GNUC__) && (__GNUC__ >= 4)
#pragma GCC system_header
#endif
#include <limits.h>
# define BOOST__STDC_CONSTANT_MACROS_DEFINED # define BOOST__STDC_CONSTANT_MACROS_DEFINED
# if defined(BOOST_HAS_MS_INT64) # if defined(BOOST_HAS_MS_INT64)
// //
// Borland/Intel/Microsoft compilers have width specific suffixes: // Borland/Intel/Microsoft compilers have width specific suffixes:
// //
#ifndef INT8_C
# define INT8_C(value) value##i8 # define INT8_C(value) value##i8
#endif
#ifndef INT16_C
# define INT16_C(value) value##i16 # define INT16_C(value) value##i16
#endif
#ifndef INT32_C
# define INT32_C(value) value##i32 # define INT32_C(value) value##i32
#endif
#ifndef INT64_C
# define INT64_C(value) value##i64 # define INT64_C(value) value##i64
#endif
# ifdef __BORLANDC__ # ifdef __BORLANDC__
// Borland bug: appending ui8 makes the type a signed char // Borland bug: appending ui8 makes the type a signed char
# define UINT8_C(value) static_cast<unsigned char>(value##u) # define UINT8_C(value) static_cast<unsigned char>(value##u)
# else # else
# define UINT8_C(value) value##ui8 # define UINT8_C(value) value##ui8
# endif # endif
#ifndef UINT16_C
# define UINT16_C(value) value##ui16 # define UINT16_C(value) value##ui16
#endif
#ifndef UINT32_C
# define UINT32_C(value) value##ui32 # define UINT32_C(value) value##ui32
#endif
#ifndef UINT64_C
# define UINT64_C(value) value##ui64 # define UINT64_C(value) value##ui64
#endif
#ifndef INTMAX_C
# define INTMAX_C(value) value##i64 # define INTMAX_C(value) value##i64
# define UINTMAX_C(value) value##ui64 # define UINTMAX_C(value) value##ui64
#endif
# else # else
// do it the old fashioned way: // do it the old fashioned way:
// 8-bit types ------------------------------------------------------------// // 8-bit types ------------------------------------------------------------//
# if UCHAR_MAX == 0xff # if (UCHAR_MAX == 0xff) && !defined(INT8_C)
# define INT8_C(value) static_cast<boost::int8_t>(value) # define INT8_C(value) static_cast<boost::int8_t>(value)
# define UINT8_C(value) static_cast<boost::uint8_t>(value##u) # define UINT8_C(value) static_cast<boost::uint8_t>(value##u)
# endif # endif
// 16-bit types -----------------------------------------------------------// // 16-bit types -----------------------------------------------------------//
# if USHRT_MAX == 0xffff # if (USHRT_MAX == 0xffff) && !defined(INT16_C)
# define INT16_C(value) static_cast<boost::int16_t>(value) # define INT16_C(value) static_cast<boost::int16_t>(value)
# define UINT16_C(value) static_cast<boost::uint16_t>(value##u) # define UINT16_C(value) static_cast<boost::uint16_t>(value##u)
# endif # endif
// 32-bit types -----------------------------------------------------------// // 32-bit types -----------------------------------------------------------//
#ifndef INT32_C
# if UINT_MAX == 0xffffffff # if (UINT_MAX == 0xffffffff)
# define INT32_C(value) value # define INT32_C(value) value
# define UINT32_C(value) value##u # define UINT32_C(value) value##u
# elif ULONG_MAX == 0xffffffff # elif ULONG_MAX == 0xffffffff
# define INT32_C(value) value##L # define INT32_C(value) value##L
# define UINT32_C(value) value##uL # define UINT32_C(value) value##uL
# endif # endif
#endif
// 64-bit types + intmax_t and uintmax_t ----------------------------------// // 64-bit types + intmax_t and uintmax_t ----------------------------------//
#ifndef INT64_C
# if defined(BOOST_HAS_LONG_LONG) && \ # if defined(BOOST_HAS_LONG_LONG) && \
(defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) || defined(_LLONG_MAX))
# if defined(__hpux) # if defined(__hpux)
// HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions
# elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || \ # define INT64_C(value) value##LL
(defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) || \ # define UINT64_C(value) value##uLL
(defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U) # elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) || \
(defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) || \
(defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL) || \
(defined(_LLONG_MAX) && _LLONG_MAX == 18446744073709551615ULL)
# define INT64_C(value) value##LL
# define UINT64_C(value) value##uLL
# else # else
# error defaults not correct; you must hand modify boost/cstdint.hpp # error defaults not correct; you must hand modify boost/cstdint.hpp
# endif # endif
# define INT64_C(value) value##LL
# define UINT64_C(value) value##uLL
# elif ULONG_MAX != 0xffffffff # elif ULONG_MAX != 0xffffffff
# if ULONG_MAX == 18446744073709551615 // 2**64 - 1 # if ULONG_MAX == 18446744073709551615U // 2**64 - 1
# define INT64_C(value) value##L # define INT64_C(value) value##L
# define UINT64_C(value) value##uL # define UINT64_C(value) value##uL
# else # else
# error defaults not correct; you must hand modify boost/cstdint.hpp # error defaults not correct; you must hand modify boost/cstdint.hpp
# endif # endif
# elif defined(BOOST_HAS_LONG_LONG)
// Usual macros not defined, work things out for ourselves:
# if(~0uLL == 18446744073709551615ULL)
# define INT64_C(value) value##LL
# define UINT64_C(value) value##uLL
# else
# error defaults not correct; you must hand modify boost/cstdint.hpp
# endif
# else
# error defaults not correct; you must hand modify boost/cstdint.hpp
# endif # endif
# ifdef BOOST_NO_INT64_T # ifdef BOOST_NO_INT64_T
@ -420,26 +498,10 @@ BOOST_HAS_STDINT_H is defined (John Maddock).
# define INTMAX_C(value) INT64_C(value) # define INTMAX_C(value) INT64_C(value)
# define UINTMAX_C(value) UINT64_C(value) # define UINTMAX_C(value) UINT64_C(value)
# endif # endif
#endif
# endif // Borland/Microsoft specific width suffixes # endif // Borland/Microsoft specific width suffixes
#endif // INT#_C macros.
#elif defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(__STDC_CONSTANT_MACROS) && !defined(BOOST_HAS_STDINT_H)
//
// undef all the macros:
//
# undef INT8_C
# undef INT16_C
# undef INT32_C
# undef INT64_C
# undef UINT8_C
# undef UINT16_C
# undef UINT32_C
# undef UINT64_C
# undef INTMAX_C
# undef UINTMAX_C
#endif // __STDC_CONSTANT_MACROS_DEFINED etc.

View File

@ -28,7 +28,7 @@ namespace detail
inline void current_function_helper() inline void current_function_helper()
{ {
#if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) #if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) || defined(__ghs__)
# define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__ # define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
@ -65,3 +65,4 @@ inline void current_function_helper()
} // namespace boost } // namespace boost
#endif // #ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED #endif // #ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED

View File

@ -40,115 +40,30 @@
#include <algorithm> #include <algorithm>
#include <vector> #include <vector>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/range/algorithm/equal.hpp>
#include <boost/range/algorithm/sort.hpp>
#include <boost/range/algorithm/stable_sort.hpp>
#include <boost/range/algorithm/find_if.hpp>
#include <boost/range/algorithm/count.hpp>
#include <boost/range/algorithm/count_if.hpp>
#include <boost/range/algorithm_ext/is_sorted.hpp>
#include <boost/range/algorithm_ext/iota.hpp>
namespace boost { namespace boost {
template <typename Iter1, typename Iter2>
Iter1 begin(const std::pair<Iter1, Iter2>& p) { return p.first; }
template <typename Iter1, typename Iter2>
Iter2 end(const std::pair<Iter1, Iter2>& p) { return p.second; }
template <typename Iter1, typename Iter2>
typename boost::detail::iterator_traits<Iter1>::difference_type
size(const std::pair<Iter1, Iter2>& p) {
return std::distance(p.first, p.second);
}
#if 0
// These seem to interfere with the std::pair overloads :(
template <typename Container>
typename Container::iterator
begin(Container& c) { return c.begin(); }
template <typename Container>
typename Container::const_iterator
begin(const Container& c) { return c.begin(); }
template <typename Container>
typename Container::iterator
end(Container& c) { return c.end(); }
template <typename Container>
typename Container::const_iterator
end(const Container& c) { return c.end(); }
template <typename Container>
typename Container::size_type
size(const Container& c) { return c.size(); }
#else
template <typename T>
typename std::vector<T>::iterator
begin(std::vector<T>& c) { return c.begin(); }
template <typename T>
typename std::vector<T>::const_iterator
begin(const std::vector<T>& c) { return c.begin(); }
template <typename T>
typename std::vector<T>::iterator
end(std::vector<T>& c) { return c.end(); }
template <typename T>
typename std::vector<T>::const_iterator
end(const std::vector<T>& c) { return c.end(); }
template <typename T>
typename std::vector<T>::size_type
size(const std::vector<T>& c) { return c.size(); }
#endif
template <class ForwardIterator, class T>
void iota(ForwardIterator first, ForwardIterator last, T value)
{
for (; first != last; ++first, ++value)
*first = value;
}
template <typename Container, typename T>
void iota(Container& c, const T& value)
{
iota(begin(c), end(c), value);
}
// Also do version with 2nd container?
template <typename Container, typename OutIter>
OutIter copy(const Container& c, OutIter result) {
return std::copy(begin(c), end(c), result);
}
template <typename Container1, typename Container2>
bool equal(const Container1& c1, const Container2& c2)
{
if (size(c1) != size(c2))
return false;
return std::equal(begin(c1), end(c1), begin(c2));
}
template <typename Container>
void sort(Container& c) { std::sort(begin(c), end(c)); }
template <typename Container, typename Predicate>
void sort(Container& c, const Predicate& p) {
std::sort(begin(c), end(c), p);
}
template <typename Container>
void stable_sort(Container& c) { std::stable_sort(begin(c), end(c)); }
template <typename Container, typename Predicate>
void stable_sort(Container& c, const Predicate& p) {
std::stable_sort(begin(c), end(c), p);
}
template <typename InputIterator, typename Predicate> template <typename InputIterator, typename Predicate>
bool any_if(InputIterator first, InputIterator last, Predicate p) bool any_if(InputIterator first, InputIterator last, Predicate p)
{ {
return std::find_if(first, last, p) != last; return std::find_if(first, last, p) != last;
} }
template <typename Container, typename Predicate> template <typename Container, typename Predicate>
bool any_if(const Container& c, Predicate p) bool any_if(const Container& c, Predicate p)
{ {
return any_if(begin(c), end(c), p); return any_if(boost::begin(c), boost::end(c), p);
} }
template <typename InputIterator, typename T> template <typename InputIterator, typename T>
@ -159,62 +74,7 @@ namespace boost {
template <typename Container, typename T> template <typename Container, typename T>
bool container_contains(const Container& c, const T& value) bool container_contains(const Container& c, const T& value)
{ {
return container_contains(begin(c), end(c), value); return container_contains(boost::begin(c), boost::end(c), value);
}
template <typename Container, typename T>
std::size_t count(const Container& c, const T& value)
{
return std::count(begin(c), end(c), value);
}
template <typename Container, typename Predicate>
std::size_t count_if(const Container& c, Predicate p)
{
return std::count_if(begin(c), end(c), p);
}
template <typename ForwardIterator>
bool is_sorted(ForwardIterator first, ForwardIterator last)
{
if (first == last)
return true;
ForwardIterator next = first;
for (++next; next != last; first = next, ++next) {
if (*next < *first)
return false;
}
return true;
}
template <typename ForwardIterator, typename StrictWeakOrdering>
bool is_sorted(ForwardIterator first, ForwardIterator last,
StrictWeakOrdering comp)
{
if (first == last)
return true;
ForwardIterator next = first;
for (++next; next != last; first = next, ++next) {
if (comp(*next, *first))
return false;
}
return true;
}
template <typename Container>
bool is_sorted(const Container& c)
{
return is_sorted(begin(c), end(c));
}
template <typename Container, typename StrictWeakOrdering>
bool is_sorted(const Container& c, StrictWeakOrdering comp)
{
return is_sorted(begin(c), end(c), comp);
} }
} // namespace boost } // namespace boost

View File

@ -1,4 +1,4 @@
/* Copyright 2003-2008 Joaquin M Lopez Munoz. /* Copyright 2003-2009 Joaquin M Lopez Munoz.
* 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)
@ -178,12 +178,31 @@ void construct(void* p,const Type& t)
new (p) Type(t); new (p) Type(t);
} }
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
/* MSVC++ issues spurious warnings about unreferencend formal parameters
* in destroy<Type> when Type is a class with trivial dtor.
*/
#pragma warning(push)
#pragma warning(disable:4100)
#endif
template<typename Type> template<typename Type>
void destroy(const Type* p) void destroy(const Type* p)
{ {
#if BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590))
const_cast<Type*>(p)->~Type();
#else
p->~Type(); p->~Type();
#endif
} }
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
#pragma warning(pop)
#endif
} /* namespace boost::detail::allocator */ } /* namespace boost::detail::allocator */
} /* namespace boost::detail */ } /* namespace boost::detail */

View File

@ -0,0 +1,47 @@
// 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

View File

@ -1,28 +1,92 @@
// Copyright 2005-2008 Daniel James. // Copyright 2005-2011 Daniel James.
// 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)
// Note: if you change this include guard, you also need to change
// container_fwd_compile_fail.cpp
#if !defined(BOOST_DETAIL_CONTAINER_FWD_HPP) #if !defined(BOOST_DETAIL_CONTAINER_FWD_HPP)
#define BOOST_DETAIL_CONTAINER_FWD_HPP #define BOOST_DETAIL_CONTAINER_FWD_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER) && (_MSC_VER >= 1020) && \
!defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
# pragma once # pragma once
#endif #endif
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) ////////////////////////////////////////////////////////////////////////////////
#define BOOST_HASH_CHAR_TRAITS string_char_traits // //
#else // Define BOOST_DETAIL_NO_CONTAINER_FWD if you don't want this header to //
#define BOOST_HASH_CHAR_TRAITS char_traits // 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 #endif
#if ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) && defined(_GLIBCXX_DEBUG)) \ #if !defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
|| BOOST_WORKAROUND(__BORLANDC__, > 0x551) \
|| BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \ #if defined(BOOST_DETAIL_NO_CONTAINER_FWD) && \
|| (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) !defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD)
#include <deque> #include <deque>
#include <list> #include <list>
@ -37,17 +101,6 @@
#include <cstddef> #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) #if defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
#include <deque> #include <deque>
#endif #endif
@ -65,13 +118,20 @@ namespace std
{ {
template <class T> class allocator; template <class T> class allocator;
template <class charT, class traits, class Allocator> class basic_string; template <class charT, class traits, class Allocator> class basic_string;
template <class charT> struct BOOST_HASH_CHAR_TRAITS;
template <class T> class complex;
}
// gcc 3.4 and greater #if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
namespace std
{ 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 !defined(BOOST_CONTAINER_FWD_BAD_DEQUE) #if !defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
template <class T, class Allocator> class deque; template <class T, class Allocator> class deque;
#endif #endif
@ -94,6 +154,9 @@ namespace std
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#endif #endif // BOOST_DETAIL_NO_CONTAINER_FWD &&
// !defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD)
#endif // BOOST_DETAIL_TEST_CONFIG_ONLY
#endif #endif

View File

@ -1,5 +1,6 @@
// Copyright 2005 Caleb Epstein // Copyright 2005 Caleb Epstein
// Copyright 2006 John Maddock // 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)
@ -42,15 +43,19 @@
# error Unknown machine endianness detected. # error Unknown machine endianness detected.
# endif # endif
# define BOOST_BYTE_ORDER __BYTE_ORDER # define BOOST_BYTE_ORDER __BYTE_ORDER
#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) #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_BIG_ENDIAN
# define BOOST_BYTE_ORDER 4321 # define BOOST_BYTE_ORDER 4321
#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) #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_LITTLE_ENDIAN
# define BOOST_BYTE_ORDER 1234 # define BOOST_BYTE_ORDER 1234
#elif defined(__sparc) || defined(__sparc__) \ #elif defined(__sparc) || defined(__sparc__) \
|| defined(_POWER) || defined(__powerpc__) \ || defined(_POWER) || defined(__powerpc__) \
|| defined(__ppc__) || defined(__hpux) \ || defined(__ppc__) || defined(__hpux) || defined(__hppa) \
|| defined(_MIPSEB) || defined(_POWER) \ || defined(_MIPSEB) || defined(_POWER) \
|| defined(__s390__) || defined(__s390__)
# define BOOST_BIG_ENDIAN # define BOOST_BIG_ENDIAN

View File

@ -54,11 +54,27 @@ 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
#include <intrin.h>
#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 * );
extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedCompareExchange( long volatile *, long, long );
extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedExchange( long volatile *, long );
extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedExchangeAdd( long volatile *, long );
#else
extern "C" long __cdecl _InterlockedIncrement( long volatile * ); extern "C" long __cdecl _InterlockedIncrement( long volatile * );
extern "C" long __cdecl _InterlockedDecrement( long volatile * ); extern "C" long __cdecl _InterlockedDecrement( long volatile * );
extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long ); extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long );
extern "C" long __cdecl _InterlockedExchange( long volatile *, long); extern "C" long __cdecl _InterlockedExchange( long volatile *, long );
extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long); extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long );
#endif
# pragma intrinsic( _InterlockedIncrement ) # pragma intrinsic( _InterlockedIncrement )
# pragma intrinsic( _InterlockedDecrement ) # pragma intrinsic( _InterlockedDecrement )
@ -94,17 +110,29 @@ extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* );
#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)
#endif
namespace boost namespace boost
{ {
namespace detail namespace detail
{ {
extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement( long volatile * ); extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedIncrement( long volatile * );
extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volatile * ); extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedDecrement( long volatile * );
extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long ); extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedCompareExchange( long volatile *, long, long );
extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volatile *, long ); extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchange( long volatile *, long );
extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( 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* );
# endif
} // namespace detail } // namespace detail
@ -116,10 +144,15 @@ extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long vol
# define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD ::boost::detail::InterlockedExchangeAdd # define BOOST_INTERLOCKED_EXCHANGE_ADD ::boost::detail::InterlockedExchangeAdd
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ # if defined(_M_IA64) || defined(_M_AMD64)
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER ::boost::detail::InterlockedCompareExchangePointer
# define BOOST_INTERLOCKED_EXCHANGE_POINTER ::boost::detail::InterlockedExchangePointer
# else
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare))) ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ # define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange))) ((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
# endif
#else #else

View File

@ -63,12 +63,17 @@ namespace is_incrementable_
tag operator,(tag,int); tag operator,(tag,int);
# define BOOST_comma(a,b) (a,b) # define BOOST_comma(a,b) (a,b)
# endif # endif
# if defined(BOOST_MSVC)
# pragma warning(push)
# pragma warning(disable:4913) // Warning about operator,
# endif
// two check overloads help us identify which operator++ was picked // two check overloads help us identify which operator++ was picked
char (& check(tag) )[2]; char (& check_(tag) )[2];
template <class T> template <class T>
char check(T const&); char check_(T const&);
template <class T> template <class T>
@ -78,7 +83,7 @@ namespace is_incrementable_
BOOST_STATIC_CONSTANT( BOOST_STATIC_CONSTANT(
bool bool
, value = sizeof(is_incrementable_::check(BOOST_comma(++x,0))) == 1 , value = sizeof(is_incrementable_::check_(BOOST_comma(++x,0))) == 1
); );
}; };
@ -89,9 +94,14 @@ namespace is_incrementable_
BOOST_STATIC_CONSTANT( BOOST_STATIC_CONSTANT(
bool bool
, value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1 , value = sizeof(is_incrementable_::check_(BOOST_comma(x++,0))) == 1
); );
}; };
# if defined(BOOST_MSVC)
# pragma warning(pop)
# endif
} }
# undef BOOST_comma # undef BOOST_comma

View File

@ -173,8 +173,8 @@ inline void lcast_set_precision(std::ios_base& stream, T*)
template<class Source, class Target> template<class Source, class Target>
inline void lcast_set_precision(std::ios_base& stream, Source*, Target*) inline void lcast_set_precision(std::ios_base& stream, Source*, Target*)
{ {
std::streamsize const s = lcast_get_precision((Source*)0); std::streamsize const s = lcast_get_precision(static_cast<Source*>(0));
std::streamsize const t = lcast_get_precision((Target*)0); std::streamsize const t = lcast_get_precision(static_cast<Target*>(0));
stream.precision(s > t ? s : t); stream.precision(s > t ? s : t);
} }

View File

@ -11,6 +11,7 @@
// boost/detail/lightweight_test.hpp - lightweight test library // boost/detail/lightweight_test.hpp - lightweight test library
// //
// Copyright (c) 2002, 2009 Peter Dimov // Copyright (c) 2002, 2009 Peter Dimov
// Copyright (2) Beman Dawes 2010, 2011
// //
// 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
@ -23,8 +24,15 @@
// int boost::report_errors() // int boost::report_errors()
// //
#include <boost/current_function.hpp>
#include <iostream> #include <iostream>
#include <boost/current_function.hpp>
#include <boost/assert.hpp>
// IDE's like Visual Studio perform better if output goes to std::cout or
// some other stream, so allow user to configure output stream:
#ifndef BOOST_LIGHTWEIGHT_TEST_OSTREAM
# define BOOST_LIGHTWEIGHT_TEST_OSTREAM std::cerr
#endif
namespace boost namespace boost
{ {
@ -32,52 +40,95 @@ namespace boost
namespace detail namespace detail
{ {
struct report_errors_reminder
{
bool called_report_errors_function;
report_errors_reminder() : called_report_errors_function(false) {}
~report_errors_reminder()
{
BOOST_ASSERT(called_report_errors_function); // verify report_errors() was called
}
};
inline report_errors_reminder& report_errors_remind()
{
static report_errors_reminder r;
return r;
}
inline int & test_errors() inline int & test_errors()
{ {
static int x = 0; static int x = 0;
report_errors_remind();
return x; return x;
} }
inline void test_failed_impl(char const * expr, char const * file, int line, char const * function) inline void test_failed_impl(char const * expr, char const * file, int line, char const * function)
{ {
std::cerr << file << "(" << line << "): test '" << expr << "' failed in function '" << function << "'" << std::endl; BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< file << "(" << line << "): test '" << expr << "' failed in function '"
<< function << "'" << std::endl;
++test_errors(); ++test_errors();
} }
inline void error_impl(char const * msg, char const * file, int line, char const * function) inline void error_impl(char const * msg, char const * file, int line, char const * function)
{ {
std::cerr << file << "(" << line << "): " << msg << " in function '" << function << "'" << std::endl; BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< file << "(" << line << "): " << msg << " in function '"
<< function << "'" << std::endl;
++test_errors(); ++test_errors();
} }
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 ) 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 )
{ {
if( t == u ) if( t == u )
{ {
} }
else else
{ {
std::cerr << file << "(" << line << "): test '" << expr1 << " == " << expr2 BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< file << "(" << line << "): test '" << expr1 << " == " << expr2
<< "' failed in function '" << function << "': " << "' failed in function '" << function << "': "
<< "'" << t << "' != '" << u << "'" << std::endl; << "'" << t << "' != '" << u << "'" << std::endl;
++test_errors(); ++test_errors();
} }
} }
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 } // namespace detail
inline int report_errors() inline int report_errors()
{ {
detail::report_errors_remind().called_report_errors_function = true;
int errors = detail::test_errors(); int errors = detail::test_errors();
if( errors == 0 ) if( errors == 0 )
{ {
std::cerr << "No errors detected." << std::endl; BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< "No errors detected." << std::endl;
return 0; return 0;
} }
else else
{ {
std::cerr << errors << " error" << (errors == 1? "": "s") << " detected." << std::endl; BOOST_LIGHTWEIGHT_TEST_OSTREAM
<< errors << " error" << (errors == 1? "": "s") << " detected." << std::endl;
return 1; return 1;
} }
} }
@ -87,5 +138,6 @@ inline int report_errors()
#define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)) #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_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) )
#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED #endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED

View File

@ -4,7 +4,7 @@
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // License, Version 1.0. (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)
// //
// See http://www.boost.org/lib/optional for documentation. // See http://www.boost.org/libs/optional for documentation.
// //
// You are welcome to contact the author at: // You are welcome to contact the author at:
// fernando_cacciola@hotmail.com // fernando_cacciola@hotmail.com

View File

@ -0,0 +1,337 @@
// scoped_enum_emulation.hpp ---------------------------------------------------------//
// Copyright Beman Dawes, 2009
// Copyright (C) 2011-2012 Vicente J. Botet Escriba
// Copyright (C) 2012 Anthony Williams
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
/*
[section:scoped_enums Scoped Enums]
Generates C++0x scoped enums if the feature is present, otherwise emulates C++0x
scoped enums with C++03 namespaces and enums. The Boost.Config BOOST_NO_SCOPED_ENUMS
macro is used to detect feature support.
See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf for a
description of the scoped enum feature. Note that the committee changed the name
from strongly typed enum to scoped enum.
Some of the enumerations defined in the standard library are scoped enums.
enum class future_errc
{
broken_promise,
future_already_retrieved,
promise_already_satisfied,
no_state
};
On compilers that don't support them, the library provides two emulations:
[heading Strict]
* Able to specify the underlying type.
* explicit conversion to/from underlying type.
* The wrapper is not a C++03 enum type.
The user can declare declare these types as
BOOST_SCOPED_ENUM_DECLARE_BEGIN(future_errc)
{
broken_promise,
future_already_retrieved,
promise_already_satisfied,
no_state
}
BOOST_SCOPED_ENUM_DECLARE_END(future_errc)
These macros allows to use 'future_errc' in almost all the cases as an scoped enum.
future_errc err = future_errc::no_state;
There are however some limitations:
* The type is not a C++ enum, so 'is_enum<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_SCOPED_ENUMS
template <>
struct BOOST_SYMBOL_VISIBLE is_error_code_enum<future_errc> : public true_type { };
#endif
use
#ifdef BOOST_NO_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
#define BOOST_SCOPED_ENUM_EMULATION_HPP
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
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 <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_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_SCOPED_ENUMS
#ifndef BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
explicit operator underlying_type() const { return get_underlying_value_(); }
#else
#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR
#endif
/**
* Start a declaration of a scoped enum.
*
* @param EnumType The new scoped enum.
* @param UnderlyingType The underlying type.
*/
#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType, UnderlyingType) \
struct EnumType { \
typedef UnderlyingType underlying_type; \
EnumType() BOOST_NOEXCEPT {} \
explicit EnumType(underlying_type v) : v_(v) {} \
underlying_type get_underlying_value_() const { return v_; } \
BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
private: \
underlying_type v_; \
typedef EnumType self_type; \
public: \
enum enum_type
#define BOOST_SCOPED_ENUM_DECLARE_END2() \
enum_type get_native_value_() const BOOST_NOEXCEPT { return enum_type(v_); } \
operator enum_type() const BOOST_NOEXCEPT { return get_native_value_(); } \
friend bool operator ==(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==enum_type(rhs.v_); } \
friend bool operator ==(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==rhs; } \
friend bool operator ==(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs==enum_type(rhs.v_); } \
friend bool operator !=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=enum_type(rhs.v_); } \
friend bool operator !=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=rhs; } \
friend bool operator !=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs!=enum_type(rhs.v_); } \
friend bool operator <(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<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_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)
//#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

View File

@ -19,20 +19,72 @@
#if defined( BOOST_NO_TYPEID ) #if defined( BOOST_NO_TYPEID )
#include <boost/current_function.hpp>
#include <functional>
namespace boost namespace boost
{ {
namespace detail namespace detail
{ {
typedef void* sp_typeinfo; class sp_typeinfo
{
private:
sp_typeinfo( sp_typeinfo const& );
sp_typeinfo& operator=( sp_typeinfo const& );
char const * name_;
public:
explicit sp_typeinfo( char const * name ): name_( name )
{
}
bool operator==( sp_typeinfo const& rhs ) const
{
return this == &rhs;
}
bool operator!=( sp_typeinfo const& rhs ) const
{
return this != &rhs;
}
bool before( sp_typeinfo const& rhs ) const
{
return std::less< sp_typeinfo const* >()( this, &rhs );
}
char const* name() const
{
return name_;
}
};
template<class T> struct sp_typeid_ template<class T> struct sp_typeid_
{ {
static char v_; static sp_typeinfo ti_;
static char const * name()
{
return BOOST_CURRENT_FUNCTION;
}
}; };
template<class T> char sp_typeid_< T >::v_; #if defined(__SUNPRO_CC)
// see #4199, the Sun Studio compiler gets confused about static initialization
// constructor arguments. But an assignment works just fine.
template<class T> sp_typeinfo sp_typeid_< T >::ti_ = sp_typeid_< T >::name();
#else
template<class T> sp_typeinfo sp_typeid_< T >::ti_(sp_typeid_< T >::name());
#endif
template<class T> struct sp_typeid_< T & >: sp_typeid_< T >
{
};
template<class T> struct sp_typeid_< T const >: sp_typeid_< T > template<class T> struct sp_typeid_< T const >: sp_typeid_< T >
{ {
@ -50,7 +102,7 @@ template<class T> struct sp_typeid_< T const volatile >: sp_typeid_< T >
} // namespace boost } // namespace boost
#define BOOST_SP_TYPEID(T) (&boost::detail::sp_typeid_<T>::v_) #define BOOST_SP_TYPEID(T) (boost::detail::sp_typeid_<T>::ti_)
#else #else

View File

@ -79,25 +79,18 @@
// specialized on those types for this to work. // specialized on those types for this to work.
#include <locale> #include <locale>
// for mbstate_t #include <cwchar> // for mbstate_t
#include <wchar.h> #include <cstddef> // for std::size_t
// for std::size_t
#include <cstddef>
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std { namespace std {
#if defined(__LIBCOMO__) using ::mbstate_t;
using ::mbstate_t; using ::size_t;
#elif defined(BOOST_DINKUMWARE_STDLIB) && !defined(__BORLANDC__) }
using ::mbstate_t; #endif
#elif defined(__SGI_STL_PORT)
#elif defined(BOOST_NO_STDC_NAMESPACE)
using ::mbstate_t;
using ::codecvt;
#endif
} // namespace std
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) #if !defined(__MSL_CPP__) && !defined(__LIBCOMO__)
#define BOOST_CODECVT_DO_LENGTH_CONST const #define BOOST_CODECVT_DO_LENGTH_CONST const

View File

@ -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).
@ -159,7 +159,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_out(
to_next = to - (i+1); to_next = to - (i+1);
return std::codecvt_base::partial; return std::codecvt_base::partial;
} }
*from++; ++from;
} }
from_next = from; from_next = from;
to_next = to; to_next = to;
@ -231,9 +231,6 @@ int get_cont_octet_out_count_impl(wchar_t word){
return 2; return 2;
} }
// note the following code will generate on some platforms where
// wchar_t is defined as UCS2. The warnings are superfluous as
// the specialization is never instantitiated with such compilers.
template<> template<>
int get_cont_octet_out_count_impl<4>(wchar_t word){ int get_cont_octet_out_count_impl<4>(wchar_t word){
if (word < 0x80) { if (word < 0x80) {
@ -242,7 +239,22 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){
if (word < 0x800) { if (word < 0x800) {
return 1; return 1;
} }
if (word < 0x10000) {
// Note that the following code will generate warnings on some platforms
// where wchar_t is defined as UCS2. The warnings are superfluous as the
// specialization is never instantitiated with such compilers, but this
// can cause problems if warnings are being treated as errors, so we guard
// against that. Including <boost/detail/utf8_codecvt_facet.hpp> as we do
// should be enough to get WCHAR_MAX defined.
#if !defined(WCHAR_MAX)
# error WCHAR_MAX not defined!
#endif
// cope with VC++ 7.1 or earlier having invalid WCHAR_MAX
#if defined(_MSC_VER) && _MSC_VER <= 1310 // 7.1 or earlier
return 2;
#elif WCHAR_MAX > 0x10000
if (word < 0x10000) {
return 2; return 2;
} }
if (word < 0x200000) { if (word < 0x200000) {
@ -252,6 +264,10 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){
return 4; return 4;
} }
return 5; return 5;
#else
return 2;
#endif
} }
} // namespace anonymous } // namespace anonymous

View File

@ -65,6 +65,11 @@
#else #else
#define BOOST_MSVC_WORKAROUND_GUARD 0 #define BOOST_MSVC_WORKAROUND_GUARD 0
#endif #endif
#ifndef BOOST_MSVC_FULL_VER
#define BOOST_MSVC_FULL_VER_WORKAROUND_GUARD 1
#else
#define BOOST_MSVC_FULL_VER_WORKAROUND_GUARD 0
#endif
#ifndef __GNUC__ #ifndef __GNUC__
#define __GNUC___WORKAROUND_GUARD 1 #define __GNUC___WORKAROUND_GUARD 1
#else #else

View File

@ -6,14 +6,6 @@
#ifndef UUID_1D94A7C6054E11DB9804B622A1EF5492 #ifndef UUID_1D94A7C6054E11DB9804B622A1EF5492
#define UUID_1D94A7C6054E11DB9804B622A1EF5492 #define UUID_1D94A7C6054E11DB9804B622A1EF5492
#include <boost/exception/diagnostic_information.hpp> #error The header <boost/exception.hpp> has been deprecated. Please #include <boost/exception/all.hpp> instead.
#include <boost/exception/error_info.hpp>
#include <boost/exception/exception.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/info.hpp>
#include <boost/exception/info_tuple.hpp>
#ifndef BOOST_NO_EXCEPTIONS
#include <boost/exception_ptr.hpp>
#endif
#endif #endif

View File

@ -5,6 +5,12 @@
#ifndef UUID_7E83C166200811DE885E826156D89593 #ifndef UUID_7E83C166200811DE885E826156D89593
#define UUID_7E83C166200811DE885E826156D89593 #define UUID_7E83C166200811DE885E826156D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
namespace namespace
boost boost
@ -31,4 +37,7 @@ boost
} }
} }
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif #endif

View File

@ -0,0 +1,17 @@
//Copyright (c) 2009 Emil Dotchevski and Reverge Studios, Inc.
//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)
#ifndef UUID_61531AB0680611DEADD5846855D89593
#define UUID_61531AB0680611DEADD5846855D89593
#if defined(_MSC_VER)
#define BOOST_ATTRIBUTE_NORETURN __declspec(noreturn)
#elif defined(__GNUC__)
#define BOOST_ATTRIBUTE_NORETURN __attribute__((__noreturn__))
#else
#define BOOST_ATTRIBUTE_NORETURN
#endif
#endif

View File

@ -1,10 +1,16 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. //Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
//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)
#ifndef UUID_CE6983AC753411DDA764247956D89593 #ifndef UUID_CE6983AC753411DDA764247956D89593
#define UUID_CE6983AC753411DDA764247956D89593 #define UUID_CE6983AC753411DDA764247956D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
#include <string> #include <string>
@ -19,7 +25,7 @@ boost
{ {
public: public:
virtual char const * tag_typeid_name() const = 0; virtual std::string tag_typeid_name() const = 0;
virtual std::string value_as_string() const = 0; virtual std::string value_as_string() const = 0;
protected: protected:
@ -49,13 +55,22 @@ boost
return value_; return value_;
} }
value_type &
value()
{
return value_;
}
private: private:
char const * tag_typeid_name() const; std::string tag_typeid_name() const;
std::string value_as_string() const; std::string value_as_string() const;
value_type const value_; value_type value_;
}; };
} }
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif #endif

View File

@ -5,6 +5,12 @@
#ifndef UUID_898984B4076411DD973EDFA055D89593 #ifndef UUID_898984B4076411DD973EDFA055D89593
#define UUID_898984B4076411DD973EDFA055D89593 #define UUID_898984B4076411DD973EDFA055D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
#include <ostream> #include <ostream>
@ -14,8 +20,21 @@ boost
namespace namespace
to_string_detail to_string_detail
{ {
template <class T,class CharT,class Traits> struct
char operator<<( std::basic_ostream<CharT,Traits> &, T const & ); partial_ordering_helper1
{
template <class CharT,class Traits>
partial_ordering_helper1( std::basic_ostream<CharT,Traits> & );
};
struct
partial_ordering_helper2
{
template <class T>
partial_ordering_helper2( T const & );
};
char operator<<( partial_ordering_helper1, partial_ordering_helper2 );
template <class T,class CharT,class Traits> template <class T,class CharT,class Traits>
struct struct
@ -35,4 +54,7 @@ boost
}; };
} }
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif #endif

View File

@ -5,12 +5,19 @@
#ifndef UUID_6F463AC838DF11DDA3E6909F56D89593 #ifndef UUID_6F463AC838DF11DDA3E6909F56D89593
#define UUID_6F463AC838DF11DDA3E6909F56D89593 #define UUID_6F463AC838DF11DDA3E6909F56D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
#include <boost/exception/detail/type_info.hpp> #include <boost/exception/detail/type_info.hpp>
#include <iomanip> #include <iomanip>
#include <ios> #include <ios>
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <cstdlib>
namespace namespace
boost boost
@ -21,11 +28,11 @@ boost
template <class T> template <class T>
inline inline
std::string std::string
object_hex_dump( T const & x, size_t max_size=16 ) object_hex_dump( T const & x, std::size_t max_size=16 )
{ {
std::ostringstream s; std::ostringstream s;
s << "type: " << type_name<T>() << ", size: " << sizeof(T) << ", dump: "; s << "type: " << type_name<T>() << ", size: " << sizeof(T) << ", dump: ";
size_t n=sizeof(T)>max_size?max_size:sizeof(T); std::size_t n=sizeof(T)>max_size?max_size:sizeof(T);
s.fill('0'); s.fill('0');
s.width(2); s.width(2);
unsigned char const * b=reinterpret_cast<unsigned char const *>(&x); unsigned char const * b=reinterpret_cast<unsigned char const *>(&x);
@ -37,4 +44,7 @@ boost
} }
} }
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif #endif

View File

@ -1,79 +1,55 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. //Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
//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)
#ifndef UUID_C3E1741C754311DDB2834CCA55D89593 #ifndef UUID_C3E1741C754311DDB2834CCA55D89593
#define UUID_C3E1741C754311DDB2834CCA55D89593 #define UUID_C3E1741C754311DDB2834CCA55D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
#include <boost/detail/sp_typeinfo.hpp> #include <boost/detail/sp_typeinfo.hpp>
#include <boost/current_function.hpp> #include <boost/current_function.hpp>
#include <boost/config.hpp>
#ifndef BOOST_NO_TYPEID
#include <boost/units/detail/utility.hpp>
#endif
#include <string>
namespace namespace
boost boost
{ {
template <class T> template <class T>
inline inline
char const * std::string
tag_type_name() tag_type_name()
{ {
#ifdef BOOST_NO_TYPEID #ifdef BOOST_NO_TYPEID
return BOOST_CURRENT_FUNCTION; return BOOST_CURRENT_FUNCTION;
#else #else
return typeid(T*).name(); return units::detail::demangle(typeid(T*).name());
#endif #endif
} }
template <class T> template <class T>
inline inline
char const * std::string
type_name() type_name()
{ {
#ifdef BOOST_NO_TYPEID #ifdef BOOST_NO_TYPEID
return BOOST_CURRENT_FUNCTION; return BOOST_CURRENT_FUNCTION;
#else #else
return typeid(T).name(); return units::detail::demangle(typeid(T).name());
#endif #endif
} }
namespace namespace
exception_detail exception_detail
{ {
#ifdef BOOST_NO_TYPEID
struct
type_info_
{
detail::sp_typeinfo type_;
char const * name_;
explicit
type_info_( detail::sp_typeinfo type, char const * name ):
type_(type),
name_(name)
{
}
friend
bool
operator==( type_info_ const & a, type_info_ const & b )
{
return a.type_==b.type_;
}
friend
bool
operator<( type_info_ const & a, type_info_ const & b )
{
return a.type_<b.type_;
}
char const *
name() const
{
return name_;
}
};
#else
struct struct
type_info_ type_info_
{ {
@ -85,46 +61,23 @@ boost
{ {
} }
type_info_( detail::sp_typeinfo const & type, char const * ):
type_(&type)
{
}
friend
bool
operator==( type_info_ const & a, type_info_ const & b )
{
return (*a.type_)==(*b.type_);
}
friend friend
bool bool
operator<( type_info_ const & a, type_info_ const & b ) operator<( type_info_ const & a, type_info_ const & b )
{ {
return 0!=(a.type_->before(*b.type_)); return 0!=(a.type_->before(*b.type_));
} }
char const *
name() const
{
return type_->name();
}
}; };
#endif
inline
bool
operator!=( type_info_ const & a, type_info_ const & b )
{
return !(a==b);
}
} }
} }
#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T),::boost::tag_type_name<T>()) #define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T))
#ifndef BOOST_NO_RTTI #ifndef BOOST_NO_RTTI
#define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x)) #define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x))
#endif #endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif #endif

View File

@ -1,152 +1,200 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. //Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
//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)
#ifndef UUID_0552D49838DD11DD90146B8956D89593 #ifndef UUID_0552D49838DD11DD90146B8956D89593
#define UUID_0552D49838DD11DD90146B8956D89593 #define UUID_0552D49838DD11DD90146B8956D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/exception/get_error_info.hpp> #include <boost/exception/get_error_info.hpp>
#include <boost/exception/info.hpp>
#include <boost/utility/enable_if.hpp> #include <boost/utility/enable_if.hpp>
#ifndef BOOST_NO_RTTI
#include <boost/units/detail/utility.hpp>
#endif
#include <exception> #include <exception>
#include <sstream> #include <sstream>
#include <string> #include <string>
#ifndef BOOST_NO_EXCEPTIONS
#include <boost/exception/current_exception_cast.hpp>
namespace
boost
{
namespace
exception_detail
{
std::string diagnostic_information_impl( boost::exception const *, std::exception const *, bool );
}
inline
std::string
current_exception_diagnostic_information()
{
boost::exception const * be=current_exception_cast<boost::exception const>();
std::exception const * se=current_exception_cast<std::exception const>();
if( be || se )
return exception_detail::diagnostic_information_impl(be,se,true);
else
return "No diagnostic information available.";
}
}
#endif
namespace namespace
boost boost
{ {
namespace namespace
exception_detail exception_detail
{ {
template <class T>
struct
enable_boost_exception_overload
{
struct yes { char q[100]; };
typedef char no;
static yes check(exception const *);
static no check(...);
enum e { value=sizeof(check((T*)0))==sizeof(yes) };
};
template <class T>
struct
enable_std_exception_overload
{
struct yes { char q[100]; };
typedef char no;
static yes check(std::exception const *);
static no check(...);
enum e { value = !enable_boost_exception_overload<T>::value && sizeof(check((T*)0))==sizeof(yes) };
};
#ifndef BOOST_NO_RTTI
template <class T>
inline inline
std::string exception const *
dynamic_exception_type( T const & x ) get_boost_exception( exception const * e )
{ {
return std::string("Dynamic exception type: ") + BOOST_EXCEPTION_DYNAMIC_TYPEID(x).name(); return e;
} }
#endif
inline inline
char const * exception const *
get_diagnostic_information( exception const & x ) get_boost_exception( ... )
{ {
if( error_info_container * c=x.data_.get() )
#ifndef BOOST_NO_EXCEPTIONS
try
{
#endif
return c->diagnostic_information();
#ifndef BOOST_NO_EXCEPTIONS
}
catch(...)
{
}
#endif
return 0; return 0;
} }
inline inline
std::string std::exception const *
boost_diagnostic_information( exception const & x ) get_std_exception( std::exception const * e )
{ {
std::ostringstream tmp; return e;
if( char const * const * f=get_error_info<throw_file>(x) ) }
inline
std::exception const *
get_std_exception( ... )
{
return 0;
}
inline
char const *
get_diagnostic_information( exception const & x, char const * header )
{
#ifndef BOOST_NO_EXCEPTIONS
try
{ {
tmp << *f;
if( int const * l=get_error_info<throw_line>(x) )
tmp << '(' << *l << "): ";
}
tmp << "Throw in function ";
if( char const * const * fn=get_error_info<throw_function>(x) )
tmp << *fn;
else
tmp << "(unknown)";
tmp << std::endl;
#ifndef BOOST_NO_RTTI
tmp << dynamic_exception_type(x) << std::endl;
if( std::exception const * e=dynamic_cast<std::exception const *>(&x) )
tmp << "std::exception::what: " << e->what() << std::endl;
#endif #endif
if( char const * s=exception_detail::get_diagnostic_information(x) ) error_info_container * c=x.data_.get();
if( *s ) if( !c )
tmp << s; x.data_.adopt(c=new exception_detail::error_info_container_impl);
return tmp.str(); char const * di=c->diagnostic_information(header);
BOOST_ASSERT(di!=0);
return di;
#ifndef BOOST_NO_EXCEPTIONS
}
catch(...)
{
return 0;
}
#endif
} }
inline inline
std::string std::string
std_diagnostic_information( std::exception const & x ) diagnostic_information_impl( boost::exception const * be, std::exception const * se, bool with_what )
{ {
std::ostringstream tmp; if( !be && !se )
return "Unknown exception.";
#ifndef BOOST_NO_RTTI #ifndef BOOST_NO_RTTI
if( exception const * e=dynamic_cast<exception const *>(&x) ) if( !be )
return boost_diagnostic_information(*e); be=dynamic_cast<boost::exception const *>(se);
tmp << dynamic_exception_type(x) << std::endl; if( !se )
se=dynamic_cast<std::exception const *>(be);
#endif #endif
tmp << "std::exception::what: " << x.what() << std::endl; char const * wh=0;
if( with_what && se )
{
wh=se->what();
if( be && exception_detail::get_diagnostic_information(*be,0)==wh )
return wh;
}
std::ostringstream tmp;
if( be )
{
char const * const * f=get_error_info<throw_file>(*be);
int const * l=get_error_info<throw_line>(*be);
char const * const * fn=get_error_info<throw_function>(*be);
if( !f && !l && !fn )
tmp << "Throw location unknown (consider using BOOST_THROW_EXCEPTION)\n";
else
{
if( f )
{
tmp << *f;
if( int const * l=get_error_info<throw_line>(*be) )
tmp << '(' << *l << "): ";
}
tmp << "Throw in function ";
if( char const * const * fn=get_error_info<throw_function>(*be) )
tmp << *fn;
else
tmp << "(unknown)";
tmp << '\n';
}
}
#ifndef BOOST_NO_RTTI
tmp << std::string("Dynamic exception type: ") <<
units::detail::demangle((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_->name()) << '\n';
#endif
if( with_what && se )
tmp << "std::exception::what: " << wh << '\n';
if( be )
if( char const * s=exception_detail::get_diagnostic_information(*be,tmp.str().c_str()) )
if( *s )
return s;
return tmp.str(); return tmp.str();
} }
} }
template <class T> template <class T>
inline std::string
typename enable_if<exception_detail::enable_boost_exception_overload<T>,std::string>::type
diagnostic_information( T const & e ) diagnostic_information( T const & e )
{ {
return exception_detail::boost_diagnostic_information(e); return exception_detail::diagnostic_information_impl(exception_detail::get_boost_exception(&e),exception_detail::get_std_exception(&e),true);
} }
template <class T>
inline inline
typename enable_if<exception_detail::enable_std_exception_overload<T>,std::string>::type char const *
diagnostic_information( T const & e ) diagnostic_information_what( exception const & e ) throw()
{ {
return exception_detail::std_diagnostic_information(e); char const * w=0;
#ifndef BOOST_NO_EXCEPTIONS
try
{
#endif
(void) exception_detail::diagnostic_information_impl(&e,0,false);
if( char const * di=exception_detail::get_diagnostic_information(e,0) )
return di;
else
return "Failed to produce boost::diagnostic_information_what()";
#ifndef BOOST_NO_EXCEPTIONS
}
catch(
... )
{
}
#endif
return w;
} }
} }
#ifndef BOOST_NO_EXCEPTIONS #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#include <boost/exception/current_exception_cast.hpp> #pragma warning(pop)
namespace
boost
{
inline
std::string
current_exception_diagnostic_information()
{
if( boost::exception const * e=current_exception_cast<boost::exception const>() )
return diagnostic_information(*e);
else if( std::exception const * e=current_exception_cast<std::exception const>() )
return diagnostic_information(*e);
else
return "No diagnostic information available.";
}
}
#endif #endif
#endif #endif

View File

@ -3,4 +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)
#ifndef UUID_EE7ECCA0433B11E1923E37064924019B
#define UUID_EE7ECCA0433B11E1923E37064924019B
namespace boost { template <class Tag,class T> class error_info; } namespace boost { template <class Tag,class T> class error_info; }
#endif

View File

@ -5,6 +5,12 @@
#ifndef UUID_274DA366004E11DCB1DDFE2E56D89593 #ifndef UUID_274DA366004E11DCB1DDFE2E56D89593
#define UUID_274DA366004E11DCB1DDFE2E56D89593 #define UUID_274DA366004E11DCB1DDFE2E56D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
namespace namespace
boost boost
@ -69,8 +75,8 @@ boost
void void
release() release()
{ {
if( px_ ) if( px_ && px_->release() )
px_->release(); px_=0;
} }
}; };
} }
@ -80,13 +86,13 @@ boost
template <class Tag,class T> template <class Tag,class T>
class error_info; class error_info;
typedef error_info<struct tag_throw_function,char const *> throw_function; typedef error_info<struct throw_function_,char const *> throw_function;
typedef error_info<struct tag_throw_file,char const *> throw_file; typedef error_info<struct throw_file_,char const *> throw_file;
typedef error_info<struct tag_throw_line,int> throw_line; typedef error_info<struct throw_line_,int> throw_line;
template <> template <>
class class
error_info<tag_throw_function,char const *> error_info<throw_function_,char const *>
{ {
public: public:
typedef char const * value_type; typedef char const * value_type;
@ -100,7 +106,7 @@ boost
template <> template <>
class class
error_info<tag_throw_file,char const *> error_info<throw_file_,char const *>
{ {
public: public:
typedef char const * value_type; typedef char const * value_type;
@ -114,7 +120,7 @@ boost
template <> template <>
class class
error_info<tag_throw_line,int> error_info<throw_line_,int>
{ {
public: public:
typedef int value_type; typedef int value_type;
@ -126,12 +132,19 @@ boost
} }
}; };
template <class E,class Tag,class T> #if defined(__GNUC__)
E const & operator<<( E const &, error_info<Tag,T> const & ); # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility push (default)
# endif
#endif
class exception; class exception;
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility pop
# endif
#endif
template <class> template <class T>
class shared_ptr; class shared_ptr;
namespace namespace
@ -143,15 +156,15 @@ boost
struct struct
error_info_container error_info_container
{ {
virtual char const * diagnostic_information() const = 0; virtual char const * diagnostic_information( char const * ) const = 0;
virtual shared_ptr<error_info_base const> get( type_info_ const & ) const = 0; virtual shared_ptr<error_info_base> get( type_info_ const & ) const = 0;
virtual void set( shared_ptr<error_info_base const> const &, type_info_ const & ) = 0; virtual void set( shared_ptr<error_info_base> const &, type_info_ const & ) = 0;
virtual void add_ref() const = 0; virtual void add_ref() const = 0;
virtual void release() const = 0; virtual bool release() const = 0;
virtual refcount_ptr<exception_detail::error_info_container> clone() const = 0;
protected: protected:
virtual
~error_info_container() throw() ~error_info_container() throw()
{ {
} }
@ -169,9 +182,28 @@ boost
template <> template <>
struct get_info<throw_line>; struct get_info<throw_line>;
char const * get_diagnostic_information( exception const & ); char const * get_diagnostic_information( exception const &, char const * );
void copy_boost_exception( exception *, exception const * );
template <class E,class Tag,class T>
E const & set_info( E const &, error_info<Tag,T> const & );
template <class E>
E const & set_info( E const &, throw_function const & );
template <class E>
E const & set_info( E const &, throw_file const & );
template <class E>
E const & set_info( E const &, throw_line const & );
} }
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility push (default)
# endif
#endif
class class
exception exception
{ {
@ -202,51 +234,42 @@ boost
#endif #endif
; ;
#if (defined(__MWERKS__) && __MWERKS__<=0x3207) || (defined(_MSC_VER) && _MSC_VER<=1310)
public:
#else
private: private:
template <class E> template <class E>
friend friend E const & exception_detail::set_info( E const &, throw_function const & );
E const &
operator<<( E const & x, throw_function const & y )
{
x.throw_function_=y.v_;
return x;
}
template <class E> template <class E>
friend friend E const & exception_detail::set_info( E const &, throw_file const & );
E const &
operator<<( E const & x, throw_file const & y )
{
x.throw_file_=y.v_;
return x;
}
template <class E> template <class E>
friend friend E const & exception_detail::set_info( E const &, throw_line const & );
E const &
operator<<( E const & x, throw_line const & y )
{
x.throw_line_=y.v_;
return x;
}
friend char const * exception_detail::get_diagnostic_information( exception const & );
template <class E,class Tag,class T> template <class E,class Tag,class T>
friend E const & operator<<( E const &, error_info<Tag,T> const & ); friend E const & exception_detail::set_info( E const &, error_info<Tag,T> const & );
friend char const * exception_detail::get_diagnostic_information( exception const &, char const * );
template <class> template <class>
friend struct exception_detail::get_info; friend struct exception_detail::get_info;
friend struct exception_detail::get_info<throw_function>; friend struct exception_detail::get_info<throw_function>;
friend struct exception_detail::get_info<throw_file>; friend struct exception_detail::get_info<throw_file>;
friend struct exception_detail::get_info<throw_line>; friend struct exception_detail::get_info<throw_line>;
friend void exception_detail::copy_boost_exception( exception *, exception const * );
#endif
mutable exception_detail::refcount_ptr<exception_detail::error_info_container> data_; mutable exception_detail::refcount_ptr<exception_detail::error_info_container> data_;
mutable char const * throw_function_; mutable char const * throw_function_;
mutable char const * throw_file_; mutable char const * throw_file_;
mutable int throw_line_; mutable int throw_line_;
}; };
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility pop
# endif
#endif
inline inline
exception:: exception::
@ -254,11 +277,44 @@ boost
{ {
} }
namespace
exception_detail
{
template <class E>
E const &
set_info( E const & x, throw_function const & y )
{
x.throw_function_=y.v_;
return x;
}
template <class E>
E const &
set_info( E const & x, throw_file const & y )
{
x.throw_file_=y.v_;
return x;
}
template <class E>
E const &
set_info( E const & x, throw_line const & y )
{
x.throw_line_=y.v_;
return x;
}
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
namespace namespace
exception_detail exception_detail
{ {
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility push (default)
# endif
#endif
template <class T> template <class T>
struct struct
error_info_injector: error_info_injector:
@ -275,12 +331,17 @@ boost
{ {
} }
}; };
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility pop
# endif
#endif
struct large_size { char c[256]; }; struct large_size { char c[256]; };
large_size dispatch( exception * ); large_size dispatch_boost_exception( exception const * );
struct small_size { }; struct small_size { };
small_size dispatch( void * ); small_size dispatch_boost_exception( void const * );
template <class,int> template <class,int>
struct enable_error_info_helper; struct enable_error_info_helper;
@ -303,7 +364,7 @@ boost
struct struct
enable_error_info_return_type enable_error_info_return_type
{ {
typedef typename enable_error_info_helper<T,sizeof(dispatch((T*)0))>::type type; typedef typename enable_error_info_helper<T,sizeof(exception_detail::dispatch_boost_exception(static_cast<T *>(0)))>::type type;
}; };
} }
@ -322,6 +383,11 @@ boost
namespace namespace
exception_detail exception_detail
{ {
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility push (default)
# endif
#endif
class class
clone_base clone_base
{ {
@ -335,12 +401,23 @@ boost
{ {
} }
}; };
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility pop
# endif
#endif
inline inline
void void
copy_boost_exception( exception * a, exception const * b ) copy_boost_exception( exception * a, exception const * b )
{ {
*a = *b; refcount_ptr<error_info_container> data;
if( error_info_container * d=b->data_.get() )
data = d->clone();
a->throw_file_ = b->throw_file_;
a->throw_line_ = b->throw_line_;
a->throw_function_ = b->throw_function_;
a->data_ = data;
} }
inline inline
@ -353,8 +430,15 @@ boost
class class
clone_impl: clone_impl:
public T, public T,
public clone_base public virtual clone_base
{ {
struct clone_tag { };
clone_impl( clone_impl const & x, clone_tag ):
T(x)
{
copy_boost_exception(this,&x);
}
public: public:
explicit explicit
@ -373,7 +457,7 @@ boost
clone_base const * clone_base const *
clone() const clone() const
{ {
return new clone_impl(*this); return new clone_impl(*this,clone_tag());
} }
void void
@ -393,4 +477,7 @@ boost
} }
} }
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif #endif

View File

@ -5,6 +5,12 @@
#ifndef UUID_1A590226753311DD9E4CCF6156D89593 #ifndef UUID_1A590226753311DD9E4CCF6156D89593
#define UUID_1A590226753311DD9E4CCF6156D89593 #define UUID_1A590226753311DD9E4CCF6156D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
#include <boost/exception/exception.hpp> #include <boost/exception/exception.hpp>
#include <boost/exception/detail/error_info_impl.hpp> #include <boost/exception/detail/error_info_impl.hpp>
@ -22,16 +28,16 @@ boost
get_info get_info
{ {
static static
typename ErrorInfo::value_type const * typename ErrorInfo::value_type *
get( exception const & x ) get( exception const & x )
{ {
if( exception_detail::error_info_container * c=x.data_.get() ) if( exception_detail::error_info_container * c=x.data_.get() )
if( shared_ptr<exception_detail::error_info_base const> eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) ) if( shared_ptr<exception_detail::error_info_base> eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) )
{ {
#ifndef BOOST_NO_RTTI #ifndef BOOST_NO_RTTI
BOOST_ASSERT( 0!=dynamic_cast<ErrorInfo const *>(eib.get()) ); BOOST_ASSERT( 0!=dynamic_cast<ErrorInfo *>(eib.get()) );
#endif #endif
ErrorInfo const * w = static_cast<ErrorInfo const *>(eib.get()); ErrorInfo * w = static_cast<ErrorInfo *>(eib.get());
return &w->value(); return &w->value();
} }
return 0; return 0;
@ -43,7 +49,7 @@ boost
get_info<throw_function> get_info<throw_function>
{ {
static static
char const * const * char const * *
get( exception const & x ) get( exception const & x )
{ {
return x.throw_function_ ? &x.throw_function_ : 0; return x.throw_function_ ? &x.throw_function_ : 0;
@ -55,7 +61,7 @@ boost
get_info<throw_file> get_info<throw_file>
{ {
static static
char const * const * char const * *
get( exception const & x ) get( exception const & x )
{ {
return x.throw_file_ ? &x.throw_file_ : 0; return x.throw_file_ ? &x.throw_file_ : 0;
@ -67,12 +73,26 @@ boost
get_info<throw_line> get_info<throw_line>
{ {
static static
int const * int *
get( exception const & x ) get( exception const & x )
{ {
return x.throw_line_!=-1 ? &x.throw_line_ : 0; return x.throw_line_!=-1 ? &x.throw_line_ : 0;
} }
}; };
template <class T,class R>
struct
get_error_info_return_type
{
typedef R * type;
};
template <class T,class R>
struct
get_error_info_return_type<T const,R>
{
typedef R const * type;
};
} }
#ifdef BOOST_NO_RTTI #ifdef BOOST_NO_RTTI
@ -83,11 +103,18 @@ boost
{ {
return exception_detail::get_info<ErrorInfo>::get(x); return exception_detail::get_info<ErrorInfo>::get(x);
} }
template <class ErrorInfo>
inline
typename ErrorInfo::value_type *
get_error_info( boost::exception & x )
{
return exception_detail::get_info<ErrorInfo>::get(x);
}
#else #else
template <class ErrorInfo,class E> template <class ErrorInfo,class E>
inline inline
typename ErrorInfo::value_type const * typename exception_detail::get_error_info_return_type<E,typename ErrorInfo::value_type>::type
get_error_info( E const & some_exception ) get_error_info( E & some_exception )
{ {
if( exception const * x = dynamic_cast<exception const *>(&some_exception) ) if( exception const * x = dynamic_cast<exception const *>(&some_exception) )
return exception_detail::get_info<ErrorInfo>::get(*x); return exception_detail::get_info<ErrorInfo>::get(*x);
@ -97,4 +124,7 @@ boost
#endif #endif
} }
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif #endif

View File

@ -1,15 +1,22 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. //Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
//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)
#ifndef UUID_8D22C4CA9CC811DCAA9133D256D89593 #ifndef UUID_8D22C4CA9CC811DCAA9133D256D89593
#define UUID_8D22C4CA9CC811DCAA9133D256D89593 #define UUID_8D22C4CA9CC811DCAA9133D256D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
#include <boost/exception/exception.hpp> #include <boost/exception/exception.hpp>
#include <boost/exception/to_string_stub.hpp> #include <boost/exception/to_string_stub.hpp>
#include <boost/exception/detail/error_info_impl.hpp> #include <boost/exception/detail/error_info_impl.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/config.hpp>
#include <map> #include <map>
namespace namespace
@ -40,7 +47,7 @@ boost
template <class Tag,class T> template <class Tag,class T>
inline inline
char const * std::string
error_info<Tag,T>:: error_info<Tag,T>::
tag_typeid_name() const tag_typeid_name() const
{ {
@ -75,38 +82,39 @@ boost
} }
void void
set( shared_ptr<error_info_base const> const & x, type_info_ const & typeid_ ) set( shared_ptr<error_info_base> const & x, type_info_ const & typeid_ )
{ {
BOOST_ASSERT(x); BOOST_ASSERT(x);
info_[typeid_] = x; info_[typeid_] = x;
diagnostic_info_str_.clear(); diagnostic_info_str_.clear();
} }
shared_ptr<error_info_base const> shared_ptr<error_info_base>
get( type_info_ const & ti ) const get( type_info_ const & ti ) const
{ {
error_info_map::const_iterator i=info_.find(ti); error_info_map::const_iterator i=info_.find(ti);
if( info_.end()!=i ) if( info_.end()!=i )
{ {
shared_ptr<error_info_base const> const & p = i->second; shared_ptr<error_info_base> const & p = i->second;
#ifndef BOOST_NO_RTTI #ifndef BOOST_NO_RTTI
BOOST_ASSERT( BOOST_EXCEPTION_DYNAMIC_TYPEID(*p)==ti ); BOOST_ASSERT( *BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ );
#endif #endif
return p; return p;
} }
return shared_ptr<error_info_base const>(); return shared_ptr<error_info_base>();
} }
char const * char const *
diagnostic_information() const diagnostic_information( char const * header ) const
{ {
if( diagnostic_info_str_.empty() ) if( header )
{ {
std::ostringstream tmp; std::ostringstream tmp;
tmp << header;
for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i ) for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i )
{ {
shared_ptr<error_info_base const> const & x = i->second; error_info_base const & x = *i->second;
tmp << '[' << x->tag_typeid_name() << "] = " << x->value_as_string() << std::endl; tmp << '[' << x.tag_typeid_name() << "] = " << x.value_as_string() << '\n';
} }
tmp.str().swap(diagnostic_info_str_); tmp.str().swap(diagnostic_info_str_);
} }
@ -117,39 +125,75 @@ boost
friend class boost::exception; friend class boost::exception;
typedef std::map< type_info_, shared_ptr<error_info_base const> > error_info_map; typedef std::map< type_info_, shared_ptr<error_info_base> > error_info_map;
error_info_map info_; error_info_map info_;
mutable std::string diagnostic_info_str_; mutable std::string diagnostic_info_str_;
mutable int count_; mutable int count_;
error_info_container_impl( error_info_container_impl const & );
error_info_container_impl & operator=( error_info_container const & );
void void
add_ref() const add_ref() const
{ {
++count_; ++count_;
} }
void bool
release() const release() const
{ {
if( !--count_ ) if( --count_ )
return false;
else
{
delete this; delete this;
return true;
}
} }
refcount_ptr<error_info_container>
clone() const
{
refcount_ptr<error_info_container> p;
error_info_container_impl * c=new error_info_container_impl;
p.adopt(c);
c->info_ = info_;
return p;
}
};
template <class E,class Tag,class T>
inline
E const &
set_info( E const & x, error_info<Tag,T> const & v )
{
typedef error_info<Tag,T> error_info_tag_t;
shared_ptr<error_info_tag_t> p( new error_info_tag_t(v) );
exception_detail::error_info_container * c=x.data_.get();
if( !c )
x.data_.adopt(c=new exception_detail::error_info_container_impl);
c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t));
return x;
}
template <class T>
struct
derives_boost_exception
{
enum e { value = (sizeof(dispatch_boost_exception((T*)0))==sizeof(large_size)) };
}; };
} }
template <class E,class Tag,class T> template <class E,class Tag,class T>
inline inline
E const & typename enable_if<exception_detail::derives_boost_exception<E>,E const &>::type
operator<<( E const & x, error_info<Tag,T> const & v ) operator<<( E const & x, error_info<Tag,T> const & v )
{ {
typedef error_info<Tag,T> error_info_tag_t; return exception_detail::set_info(x,v);
shared_ptr<error_info_tag_t> p( new error_info_tag_t(v) );
exception_detail::error_info_container * c;
if( !(c=x.data_.get()) )
x.data_.adopt(c=new exception_detail::error_info_container_impl);
c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t));
return x;
} }
} }
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif #endif

View File

@ -5,6 +5,12 @@
#ifndef UUID_63EE924290FB11DC87BB856555D89593 #ifndef UUID_63EE924290FB11DC87BB856555D89593
#define UUID_63EE924290FB11DC87BB856555D89593 #define UUID_63EE924290FB11DC87BB856555D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
#include <boost/exception/info.hpp> #include <boost/exception/info.hpp>
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
@ -12,6 +18,30 @@
namespace namespace
boost boost
{ {
template <
class E >
inline
E const &
operator<<(
E const & x,
tuple< > const & v )
{
return x;
}
template <
class E,
class Tag1,class T1 >
inline
E const &
operator<<(
E const & x,
tuple<
error_info<Tag1,T1> > const & v )
{
return x << v.template get<0>();
}
template < template <
class E, class E,
class Tag1,class T1, class Tag1,class T1,
@ -64,4 +94,7 @@ boost
} }
} }
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif #endif

View File

@ -5,6 +5,12 @@
#ifndef UUID_7E48761AD92811DC9011477D56D89593 #ifndef UUID_7E48761AD92811DC9011477D56D89593
#define UUID_7E48761AD92811DC9011477D56D89593 #define UUID_7E48761AD92811DC9011477D56D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
#include <boost/utility/enable_if.hpp> #include <boost/utility/enable_if.hpp>
#include <boost/exception/detail/is_output_streamable.hpp> #include <boost/exception/detail/is_output_streamable.hpp>
@ -71,4 +77,7 @@ boost
} }
} }
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif #endif

View File

@ -5,6 +5,12 @@
#ifndef UUID_E788439ED9F011DCB181F25B55D89593 #ifndef UUID_E788439ED9F011DCB181F25B55D89593
#define UUID_E788439ED9F011DCB181F25B55D89593 #define UUID_E788439ED9F011DCB181F25B55D89593
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
#include <boost/exception/to_string.hpp> #include <boost/exception/to_string.hpp>
#include <boost/exception/detail/object_hex_dump.hpp> #include <boost/exception/detail/object_hex_dump.hpp>
@ -97,4 +103,7 @@ boost
} }
} }
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif #endif

View File

@ -6,348 +6,6 @@
#ifndef UUID_FA5836A2CADA11DC8CD47C8555D89593 #ifndef UUID_FA5836A2CADA11DC8CD47C8555D89593
#define UUID_FA5836A2CADA11DC8CD47C8555D89593 #define UUID_FA5836A2CADA11DC8CD47C8555D89593
#include <boost/config.hpp> #include <boost/exception/detail/exception_ptr.hpp>
#ifdef BOOST_NO_EXCEPTIONS
#error This header requires exception handling to be enabled.
#endif
#include <boost/exception/exception.hpp>
#include <boost/exception/detail/type_info.hpp>
#include <boost/shared_ptr.hpp>
#include <stdexcept>
#include <new>
namespace
boost
{
class exception_ptr;
exception_ptr current_exception();
void rethrow_exception( exception_ptr const & );
class
exception_ptr
{
typedef bool exception_ptr::*unspecified_bool_type;
friend exception_ptr current_exception();
friend void rethrow_exception( exception_ptr const & );
shared_ptr<exception_detail::clone_base const> c_;
bool bad_alloc_;
struct
bad_alloc_tag
{
};
explicit
exception_ptr( bad_alloc_tag ):
bad_alloc_(true)
{
}
explicit
exception_ptr( shared_ptr<exception_detail::clone_base const> const & c ):
c_(c),
bad_alloc_(false)
{
BOOST_ASSERT(c);
}
public:
exception_ptr():
bad_alloc_(false)
{
}
operator unspecified_bool_type() const
{
return (bad_alloc_ || c_) ? &exception_ptr::bad_alloc_ : 0;
}
friend
bool
operator==( exception_ptr const & a, exception_ptr const & b )
{
return a.c_==b.c_ && a.bad_alloc_==b.bad_alloc_;
}
friend
bool
operator!=( exception_ptr const & a, exception_ptr const & b )
{
return !(a==b);
}
};
class
unknown_exception:
public exception,
public std::exception,
public exception_detail::clone_base
{
public:
unknown_exception()
{
}
explicit
unknown_exception( boost::exception const & e ):
boost::exception(e)
{
}
~unknown_exception() throw()
{
}
private:
exception_detail::clone_base const *
clone() const
{
return new unknown_exception(*this);
}
void
rethrow() const
{
throw*this;
}
};
namespace
exception_detail
{
template <class T>
class
current_exception_std_exception_wrapper:
public T,
public boost::exception,
public clone_base
{
public:
explicit
current_exception_std_exception_wrapper( T const & e1 ):
T(e1)
{
}
current_exception_std_exception_wrapper( T const & e1, boost::exception const & e2 ):
T(e1),
boost::exception(e2)
{
}
~current_exception_std_exception_wrapper() throw()
{
}
private:
clone_base const *
clone() const
{
return new current_exception_std_exception_wrapper(*this);
}
void
rethrow() const
{
throw *this;
}
};
#ifdef BOOST_NO_RTTI
template <class T>
exception const *
get_boost_exception( T const * )
{
try
{
throw;
}
catch(
exception & x )
{
return &x;
}
catch(...)
{
return 0;
}
}
#else
template <class T>
exception const *
get_boost_exception( T const * x )
{
return dynamic_cast<exception const *>(x);
}
#endif
template <class T>
inline
shared_ptr<clone_base const>
current_exception_std_exception( T const & e1 )
{
if( boost::exception const * e2 = get_boost_exception(&e1) )
return shared_ptr<clone_base const>(new current_exception_std_exception_wrapper<T>(e1,*e2));
else
return shared_ptr<clone_base const>(new current_exception_std_exception_wrapper<T>(e1));
}
inline
shared_ptr<clone_base const>
current_exception_unknown_exception()
{
return shared_ptr<clone_base const>(new unknown_exception());
}
inline
shared_ptr<clone_base const>
current_exception_unknown_boost_exception( boost::exception const & e )
{
return shared_ptr<clone_base const>(new unknown_exception(e));
}
inline
shared_ptr<clone_base const>
current_exception_unknown_std_exception( std::exception const & e )
{
if( boost::exception const * be = get_boost_exception(&e) )
return current_exception_unknown_boost_exception(*be);
else
return current_exception_unknown_exception();
}
inline
shared_ptr<clone_base const>
current_exception_impl()
{
try
{
throw;
}
catch(
exception_detail::clone_base & e )
{
return shared_ptr<exception_detail::clone_base const>(e.clone());
}
catch(
std::invalid_argument & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::out_of_range & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::logic_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::bad_alloc & e )
{
return exception_detail::current_exception_std_exception(e);
}
#ifndef BOOST_NO_TYPEID
catch(
std::bad_cast & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::bad_typeid & e )
{
return exception_detail::current_exception_std_exception(e);
}
#endif
catch(
std::bad_exception & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::exception & e )
{
return exception_detail::current_exception_unknown_std_exception(e);
}
catch(
boost::exception & e )
{
return exception_detail::current_exception_unknown_boost_exception(e);
}
catch(
... )
{
return exception_detail::current_exception_unknown_exception();
}
}
}
inline
exception_ptr
current_exception()
{
try
{
return exception_ptr(exception_detail::current_exception_impl());
}
catch(
std::bad_alloc & )
{
}
catch(
... )
{
try
{
return exception_ptr(exception_detail::current_exception_std_exception(std::bad_exception()));
}
catch(
std::bad_alloc & )
{
}
catch(
... )
{
BOOST_ASSERT(0);
}
}
return exception_ptr(exception_ptr::bad_alloc_tag());
}
template <class T>
inline
exception_ptr
copy_exception( T const & e )
{
try
{
throw enable_current_exception(e);
}
catch(
... )
{
return current_exception();
}
}
inline
void
rethrow_exception( exception_ptr const & p )
{
BOOST_ASSERT(p);
if( p.bad_alloc_ )
throw enable_current_exception(std::bad_alloc());
else
p.c_->rethrow();
}
}
#endif #endif

View File

@ -1,20 +1,20 @@
// boost/filesystem/filesystem.hpp -----------------------------------------// // boost/filesystem.hpp --------------------------------------------------------------//
// Copyright Beman Dawes 2005 // Copyright Beman Dawes 2010
// Use, modification, and distribution is subject to the Boost Software // Distributed under the Boost Software License, Version 1.0.
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // See http://www.boost.org/LICENSE_1_0.txt
// http://www.boost.org/LICENSE_1_0.txt)
// See library home page at http://www.boost.org/libs/filesystem // Library home page: http://www.boost.org/libs/filesystem
//----------------------------------------------------------------------------// //--------------------------------------------------------------------------------------//
#ifndef BOOST_FILESYSTEM_FILESYSTEM_HPP #ifndef BOOST_FILESYSTEM_FILESYSTEM_HPP
#define BOOST_FILESYSTEM_FILESYSTEM_HPP #define BOOST_FILESYSTEM_FILESYSTEM_HPP
#include <boost/filesystem/operations.hpp> // includes path.hpp # include <boost/filesystem/config.hpp>
#include <boost/filesystem/convenience.hpp> # include <boost/filesystem/path.hpp>
# include <boost/filesystem/operations.hpp>
#endif # include <boost/filesystem/convenience.hpp>
#endif // BOOST_FILESYSTEM_FILESYSTEM_HPP

View File

@ -1,98 +1,94 @@
// boost/filesystem/config.hpp ---------------------------------------------// // boost/filesystem/v3/config.hpp ----------------------------------------------------//
// Copyright Beman Dawes 2003 // Copyright Beman Dawes 2003
// Distributed under the Boost Software License, Version 1.0. (See accompanying // Distributed under the Boost Software License, Version 1.0.
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/LICENSE_1_0.txt
// See library home page at http://www.boost.org/libs/filesystem // Library home page: http://www.boost.org/libs/filesystem
//----------------------------------------------------------------------------// //--------------------------------------------------------------------------------------//
#ifndef BOOST_FILESYSTEM_CONFIG_HPP #ifndef BOOST_FILESYSTEM3_CONFIG_HPP
#define BOOST_FILESYSTEM_CONFIG_HPP #define BOOST_FILESYSTEM3_CONFIG_HPP
# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION != 3
# error Compiling Filesystem version 3 file with BOOST_FILESYSTEM_VERSION defined != 3
# endif
# if !defined(BOOST_FILESYSTEM_VERSION)
# define BOOST_FILESYSTEM_VERSION 3
# endif
#define BOOST_FILESYSTEM_I18N // aid users wishing to compile several versions #define BOOST_FILESYSTEM_I18N // aid users wishing to compile several versions
// ability to change namespace aids path_table.cpp ------------------------//
#ifndef BOOST_FILESYSTEM_NAMESPACE
# define BOOST_FILESYSTEM_NAMESPACE filesystem
#endif
// This header implements separate compilation features as described in // This header implements separate compilation features as described in
// http://www.boost.org/more/separate_compilation.html // http://www.boost.org/more/separate_compilation.html
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/system/api_config.hpp> // for BOOST_POSIX_API or BOOST_WINDOWS_API
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
// determine platform ------------------------------------------------------// // BOOST_FILESYSTEM_DEPRECATED needed for source compiles -----------------------------//
// BOOST_CYGWIN_PATH implies BOOST_WINDOWS_PATH and BOOST_POSIX_API # ifdef BOOST_FILESYSTEM_SOURCE
# define BOOST_FILESYSTEM_DEPRECATED
# if defined(BOOST_CYGWIN_PATH)
# if defined(BOOST_POSIX_PATH)
# error BOOST_POSIX_PATH is invalid when BOOST_CYGWIN_PATH is defined
# endif
# if defined(BOOST_WINDOWS_API)
# error BOOST_WINDOWS_API is invalid when BOOST_CYGWIN_PATH is defined
# endif
# define BOOST_WINDOWS_PATH
# define BOOST_POSIX_API
# endif # endif
// BOOST_POSIX_API or BOOST_WINDOWS_API specify which API to use // throw an exception ----------------------------------------------------------------//
# if defined( BOOST_WINDOWS_API ) && defined( BOOST_POSIX_API )
# error both BOOST_WINDOWS_API and BOOST_POSIX_API are defined
# elif !defined( BOOST_WINDOWS_API ) && !defined( BOOST_POSIX_API )
# if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)
# define BOOST_WINDOWS_API
# else
# define BOOST_POSIX_API
# endif
# endif
// BOOST_WINDOWS_PATH enables Windows path syntax recognition
# if !defined(BOOST_POSIX_PATH) && (defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__))
# define BOOST_WINDOWS_PATH
# endif
// narrow support only for badly broken compilers or libraries -------------//
# if defined(BOOST_NO_STD_WSTRING) || defined(BOOST_NO_SFINAE) || defined(BOOST_NO_STD_LOCALE) || BOOST_WORKAROUND(__BORLANDC__, <0x610)
# define BOOST_FILESYSTEM_NARROW_ONLY
# endif
// enable dynamic linking on Windows ---------------------------------------//
# if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)) && BOOST_WORKAROUND(__BORLANDC__, <0x610) && defined(__WIN32__)
# error Dynamic linking Boost.Filesystem does not work for Borland; use static linking instead
# endif
#ifdef BOOST_HAS_DECLSPEC // defined in config system
// we need to import/export our code only if the user has specifically
// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
// libraries to be dynamically linked, or BOOST_FILESYSTEM_DYN_LINK
// if they want just this one to be dynamically liked:
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
// export if this is our own source, otherwise import:
#ifdef BOOST_FILESYSTEM_SOURCE
# define BOOST_FILESYSTEM_DECL __declspec(dllexport)
#else
# define BOOST_FILESYSTEM_DECL __declspec(dllimport)
#endif // BOOST_FILESYSTEM_SOURCE
#endif // DYN_LINK
#endif // BOOST_HAS_DECLSPEC
// //
// if BOOST_FILESYSTEM_DECL isn't defined yet define it now: // Exceptions were originally thrown via boost::throw_exception().
#ifndef BOOST_FILESYSTEM_DECL // As throw_exception() became more complex, it caused user error reporting
#define BOOST_FILESYSTEM_DECL // to be harder to interpret, since the exception reported became much more complex.
// The immediate fix was to throw directly, wrapped in a macro to make any later change
// easier.
#define BOOST_FILESYSTEM_THROW(EX) throw EX
# if defined( BOOST_NO_STD_WSTRING )
# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
# endif
// This header implements separate compilation features as described in
// http://www.boost.org/more/separate_compilation.html
// normalize macros ------------------------------------------------------------------//
#if !defined(BOOST_FILESYSTEM_DYN_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK) \
&& !defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_ALL_STATIC_LINK)
# define BOOST_FILESYSTEM_STATIC_LINK
#endif #endif
// enable automatic library variant selection ------------------------------// #if defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_FILESYSTEM_DYN_LINK)
# define BOOST_FILESYSTEM_DYN_LINK
#elif defined(BOOST_ALL_STATIC_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK)
# define BOOST_FILESYSTEM_STATIC_LINK
#endif
#if !defined(BOOST_FILESYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_FILESYSTEM_NO_LIB) #if defined(BOOST_FILESYSTEM_DYN_LINK) && defined(BOOST_FILESYSTEM_STATIC_LINK)
# error Must not define both BOOST_FILESYSTEM_DYN_LINK and BOOST_FILESYSTEM_STATIC_LINK
#endif
#if defined(BOOST_ALL_NO_LIB) && !defined(BOOST_FILESYSTEM_NO_LIB)
# define BOOST_FILESYSTEM_NO_LIB
#endif
// enable dynamic linking ------------------------------------------------------------//
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
# if defined(BOOST_FILESYSTEM_SOURCE)
# define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_EXPORT
# else
# define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_IMPORT
# endif
#else
# define BOOST_FILESYSTEM_DECL
#endif
// enable automatic library variant selection ----------------------------------------//
#if !defined(BOOST_FILESYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) \
&& !defined(BOOST_FILESYSTEM_NO_LIB)
// //
// Set the name of our library, this will get undef'ed by auto_link.hpp // Set the name of our library, this will get undef'ed by auto_link.hpp
// once it's done with it: // once it's done with it:
@ -110,4 +106,4 @@
#include <boost/config/auto_link.hpp> #include <boost/config/auto_link.hpp>
#endif // auto-linking disabled #endif // auto-linking disabled
#endif // BOOST_FILESYSTEM_CONFIG_HPP #endif // BOOST_FILESYSTEM3_CONFIG_HPP

View File

@ -10,297 +10,49 @@
//----------------------------------------------------------------------------// //----------------------------------------------------------------------------//
#ifndef BOOST_FILESYSTEM_CONVENIENCE_HPP #ifndef BOOST_FILESYSTEM3_CONVENIENCE_HPP
#define BOOST_FILESYSTEM_CONVENIENCE_HPP #define BOOST_FILESYSTEM3_CONVENIENCE_HPP
#include <boost/config.hpp>
# if defined( BOOST_NO_STD_WSTRING )
# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
# endif
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>
#include <boost/system/error_code.hpp> #include <boost/system/error_code.hpp>
#include <vector>
#include <stack>
#include <boost/config/abi_prefix.hpp> // must be the last #include #include <boost/config/abi_prefix.hpp> // must be the last #include
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
# define BOOST_FS_FUNC(BOOST_FS_TYPE) \
template<class Path> typename boost::enable_if<is_basic_path<Path>, \
BOOST_FS_TYPE>::type
# define BOOST_FS_FUNC_STRING BOOST_FS_FUNC(typename Path::string_type)
# define BOOST_FS_TYPENAME typename
# else
# define BOOST_FS_FUNC(BOOST_FS_TYPE) inline BOOST_FS_TYPE
typedef boost::filesystem::path Path;
# define BOOST_FS_FUNC_STRING inline std::string
# define BOOST_FS_TYPENAME
# endif
namespace boost namespace boost
{ {
namespace filesystem namespace filesystem
{ {
BOOST_FS_FUNC(bool) create_directories(const Path& ph)
{
if (ph.empty() || exists(ph))
{
if ( !ph.empty() && !is_directory(ph) )
boost::throw_exception( basic_filesystem_error<Path>(
"boost::filesystem::create_directories", ph,
make_error_code( boost::system::posix::file_exists ) ) );
return false;
}
// First create branch, by calling ourself recursively
create_directories(ph.parent_path());
// Now that parent's path exists, create the directory
create_directory(ph);
return true;
}
# ifndef BOOST_FILESYSTEM_NO_DEPRECATED # ifndef BOOST_FILESYSTEM_NO_DEPRECATED
BOOST_FS_FUNC_STRING extension(const Path& ph) inline std::string extension(const path & p)
{ {
typedef BOOST_FS_TYPENAME Path::string_type string_type; return p.extension().string();
string_type filename = ph.filename();
BOOST_FS_TYPENAME string_type::size_type n = filename.rfind('.');
if (n != string_type::npos)
return filename.substr(n);
else
return string_type();
} }
BOOST_FS_FUNC_STRING basename(const Path& ph) inline std::string basename(const path & p)
{ {
typedef BOOST_FS_TYPENAME Path::string_type string_type; return p.stem().string();
string_type filename = ph.filename();
BOOST_FS_TYPENAME string_type::size_type n = filename.rfind('.');
return filename.substr(0, n);
} }
inline path change_extension( const path & p, const path & new_extension )
BOOST_FS_FUNC(Path) change_extension( const Path & ph, {
const BOOST_FS_TYPENAME Path::string_type & new_extension ) path new_p( p );
{ return ph.parent_path() / (basename(ph) + new_extension); } new_p.replace_extension( new_extension );
return new_p;
}
# endif # endif
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
// "do-the-right-thing" overloads ---------------------------------------//
inline bool create_directories(const path& ph)
{ return create_directories<path>(ph); }
inline bool create_directories(const wpath& ph)
{ return create_directories<wpath>(ph); }
# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
inline std::string extension(const path& ph)
{ return extension<path>(ph); }
inline std::wstring extension(const wpath& ph)
{ return extension<wpath>(ph); }
inline std::string basename(const path& ph)
{ return basename<path>( ph ); }
inline std::wstring basename(const wpath& ph)
{ return basename<wpath>( ph ); }
inline path change_extension( const path & ph, const std::string& new_ex )
{ return change_extension<path>( ph, new_ex ); }
inline wpath change_extension( const wpath & ph, const std::wstring& new_ex )
{ return change_extension<wpath>( ph, new_ex ); }
# endif
# endif
// basic_recursive_directory_iterator helpers --------------------------//
namespace detail
{
template< class Path >
struct recur_dir_itr_imp
{
typedef basic_directory_iterator< Path > element_type;
std::stack< element_type, std::vector< element_type > > m_stack;
int m_level;
bool m_no_push;
bool m_no_throw;
recur_dir_itr_imp() : m_level(0), m_no_push(false), m_no_throw(false) {}
};
} // namespace detail
// basic_recursive_directory_iterator ----------------------------------//
template< class Path >
class basic_recursive_directory_iterator
: public boost::iterator_facade<
basic_recursive_directory_iterator<Path>,
basic_directory_entry<Path>,
boost::single_pass_traversal_tag >
{
public:
typedef Path path_type;
basic_recursive_directory_iterator(){} // creates the "end" iterator
explicit basic_recursive_directory_iterator( const Path & dir_path );
basic_recursive_directory_iterator( const Path & dir_path,
system::error_code & ec );
int level() const { return m_imp->m_level; }
void pop();
void no_push()
{
BOOST_ASSERT( m_imp.get() && "attempt to no_push() on end iterator" );
m_imp->m_no_push = true;
}
file_status status() const
{
BOOST_ASSERT( m_imp.get()
&& "attempt to call status() on end recursive_iterator" );
return m_imp->m_stack.top()->status();
}
file_status symlink_status() const
{
BOOST_ASSERT( m_imp.get()
&& "attempt to call symlink_status() on end recursive_iterator" );
return m_imp->m_stack.top()->symlink_status();
}
private:
// shared_ptr provides shallow-copy semantics required for InputIterators.
// m_imp.get()==0 indicates the end iterator.
boost::shared_ptr< detail::recur_dir_itr_imp< Path > > m_imp;
friend class boost::iterator_core_access;
typename boost::iterator_facade<
basic_recursive_directory_iterator<Path>,
basic_directory_entry<Path>,
boost::single_pass_traversal_tag >::reference
dereference() const
{
BOOST_ASSERT( m_imp.get() && "attempt to dereference end iterator" );
return *m_imp->m_stack.top();
}
void increment();
bool equal( const basic_recursive_directory_iterator & rhs ) const
{ return m_imp == rhs.m_imp; }
};
typedef basic_recursive_directory_iterator<path> recursive_directory_iterator;
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
typedef basic_recursive_directory_iterator<wpath> wrecursive_directory_iterator;
# endif
// basic_recursive_directory_iterator implementation -------------------//
// constructors
template<class Path>
basic_recursive_directory_iterator<Path>::
basic_recursive_directory_iterator( const Path & dir_path )
: m_imp( new detail::recur_dir_itr_imp<Path> )
{
m_imp->m_stack.push( basic_directory_iterator<Path>( dir_path ) );
if ( m_imp->m_stack.top () == basic_directory_iterator<Path>() )
{ m_imp.reset (); }
}
template<class Path>
basic_recursive_directory_iterator<Path>::
basic_recursive_directory_iterator( const Path & dir_path,
system::error_code & ec )
: m_imp( new detail::recur_dir_itr_imp<Path> )
{
m_imp->m_no_throw = true;
m_imp->m_stack.push( basic_directory_iterator<Path>( dir_path, ec ) );
if ( m_imp->m_stack.top () == basic_directory_iterator<Path>() )
{ m_imp.reset (); }
}
// increment
template<class Path>
void basic_recursive_directory_iterator<Path>::increment()
{
BOOST_ASSERT( m_imp.get() && "increment on end iterator" );
static const basic_directory_iterator<Path> end_itr;
if ( m_imp->m_no_push )
{ m_imp->m_no_push = false; }
else if ( is_directory( m_imp->m_stack.top()->status() ) )
{
system::error_code ec;
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
if( m_imp->m_no_throw ) {
m_imp->m_stack.push(
basic_directory_iterator<Path>( *m_imp->m_stack.top(), ec )
);
}
else {
m_imp->m_stack.push(
basic_directory_iterator<Path>( *m_imp->m_stack.top() )
);
}
#else
m_imp->m_stack.push(
m_imp->m_no_throw
? basic_directory_iterator<Path>( *m_imp->m_stack.top(), ec )
: basic_directory_iterator<Path>( *m_imp->m_stack.top() ) );
#endif
if ( m_imp->m_stack.top() != end_itr )
{
++m_imp->m_level;
return;
}
m_imp->m_stack.pop();
}
while ( !m_imp->m_stack.empty()
&& ++m_imp->m_stack.top() == end_itr )
{
m_imp->m_stack.pop();
--m_imp->m_level;
}
if ( m_imp->m_stack.empty() ) m_imp.reset(); // done, so make end iterator
}
// pop
template<class Path>
void basic_recursive_directory_iterator<Path>::pop()
{
BOOST_ASSERT( m_imp.get() && "pop on end iterator" );
BOOST_ASSERT( m_imp->m_level > 0 && "pop with level < 1" );
static const basic_directory_iterator<Path> end_itr;
do
{
m_imp->m_stack.pop();
--m_imp->m_level;
}
while ( !m_imp->m_stack.empty()
&& ++m_imp->m_stack.top() == end_itr );
if ( m_imp->m_stack.empty() ) m_imp.reset(); // done, so make end iterator
}
} // namespace filesystem } // namespace filesystem
} // namespace boost } // namespace boost
#undef BOOST_FS_FUNC_STRING
#undef BOOST_FS_FUNC
#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas #include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
#endif // BOOST_FILESYSTEM_CONVENIENCE_HPP #endif // BOOST_FILESYSTEM3_CONVENIENCE_HPP

View File

@ -1,9 +1,9 @@
// boost/filesystem/exception.hpp -------------------------------------------// // boost/filesystem/exception.hpp -----------------------------------------------------//
// Copyright Beman Dawes 2003 // Copyright Beman Dawes 2003
// Use, modification, and distribution is subject to the Boost Software // Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // License, Version 1.0. (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)
// This header is no long used. The contents have been moved to path.hpp. // This header is no longer used. The contents have been moved to path.hpp.
// It is provided so that user code #includes do not have to be changed. // It is provided so that user code #includes do not have to be changed.

View File

@ -1,584 +1,182 @@
// boost/filesystem/fstream.hpp --------------------------------------------// // boost/filesystem/fstream.hpp ------------------------------------------------------//
// Copyright Beman Dawes 2002. // Copyright Beman Dawes 2002
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See library home page at http://www.boost.org/libs/filesystem // Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
//----------------------------------------------------------------------------// // Library home page: http://www.boost.org/libs/filesystem
#ifndef BOOST_FILESYSTEM_FSTREAM_HPP //--------------------------------------------------------------------------------------//
#define BOOST_FILESYSTEM_FSTREAM_HPP
#include <boost/filesystem/operations.hpp> // for 8.3 hack (see below) #ifndef BOOST_FILESYSTEM3_FSTREAM_HPP
#include <boost/utility/enable_if.hpp> #define BOOST_FILESYSTEM3_FSTREAM_HPP
#include <boost/detail/workaround.hpp>
#include <boost/config.hpp>
# if defined( BOOST_NO_STD_WSTRING )
# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
# endif
#include <boost/filesystem/path.hpp>
#include <iosfwd> #include <iosfwd>
#include <fstream> #include <fstream>
#include <boost/config/abi_prefix.hpp> // must be the last #include #include <boost/config/abi_prefix.hpp> // must be the last #include
// NOTE: fstream.hpp for Boost 1.32.0 and earlier supplied workarounds for // on Windows, except for standard libaries known to have wchar_t overloads for
// various compiler problems. They have been removed to ease development of the // file stream I/O, use path::string() to get a narrow character c_str()
// basic i18n functionality. Once the new interface is stable, the workarounds #if defined(BOOST_WINDOWS_API) \
// will be reinstated for any compilers that otherwise can support the rest of && (!defined(_CPPLIB_VER) || _CPPLIB_VER < 405 || defined(_STLPORT_VERSION))
// the library after internationalization. // !Dinkumware || early Dinkumware || STLPort masquerading as Dinkumware
# define BOOST_FILESYSTEM_C_STR string().c_str() // use narrow, since wide not available
#else // use the native c_str, which will be narrow on POSIX, wide on Windows
# define BOOST_FILESYSTEM_C_STR c_str()
#endif
namespace boost namespace boost
{ {
namespace filesystem namespace filesystem
{
//--------------------------------------------------------------------------------------//
// basic_filebuf //
//--------------------------------------------------------------------------------------//
template < class charT, class traits = std::char_traits<charT> >
class basic_filebuf : public std::basic_filebuf<charT,traits>
{ {
namespace detail private: // disallow copying
basic_filebuf(const basic_filebuf&);
const basic_filebuf& operator=(const basic_filebuf&);
public:
basic_filebuf() {}
virtual ~basic_filebuf() {}
basic_filebuf<charT,traits>*
open(const path& p, std::ios_base::openmode mode)
{ {
# if defined(BOOST_WINDOWS_API) && !defined(BOOST_FILESYSTEM_NARROW_ONLY) return std::basic_filebuf<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, mode)
# if !defined(BOOST_DINKUMWARE_STDLIB) || BOOST_DINKUMWARE_STDLIB < 405 ? this : 0;
// The 8.3 hack:
// C++98 does not supply a wchar_t open, so try to get an equivalent
// narrow char name based on the short, so-called 8.3, name.
// Not needed for Dinkumware 405 and later as they do supply wchar_t open.
BOOST_FILESYSTEM_DECL bool create_file_api( const std::wstring & ph,
std::ios_base::openmode mode ); // true if succeeds
BOOST_FILESYSTEM_DECL std::string narrow_path_api(
const std::wstring & ph ); // return is empty if fails
inline std::string path_proxy( const std::wstring & file_ph,
std::ios_base::openmode mode )
// Return a non-existant path if cannot supply narrow short path.
// An empty path doesn't work because some Dinkumware versions
// assert the path is non-empty.
{
std::string narrow_ph;
bool created_file( false );
if ( !exists( file_ph )
&& (mode & std::ios_base::out) != 0
&& create_file_api( file_ph, mode ) )
{
created_file = true;
}
narrow_ph = narrow_path_api( file_ph );
if ( narrow_ph.empty() )
{
if ( created_file ) remove_api( file_ph );
narrow_ph = "\x01";
}
return narrow_ph;
}
# else
// Dinkumware 405 and later does supply wchar_t functions
inline const std::wstring & path_proxy( const std::wstring & file_ph,
std::ios_base::openmode )
{ return file_ph; }
# endif
# endif
inline const std::string & path_proxy( const std::string & file_ph,
std::ios_base::openmode )
{ return file_ph; }
} // namespace detail
template < class charT, class traits = std::char_traits<charT> >
class basic_filebuf : public std::basic_filebuf<charT,traits>
{
private: // disallow copying
basic_filebuf( const basic_filebuf & );
const basic_filebuf & operator=( const basic_filebuf & );
public:
basic_filebuf() {}
virtual ~basic_filebuf() {}
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
template<class Path>
typename boost::enable_if<is_basic_path<Path>,
basic_filebuf<charT,traits> *>::type
open( const Path & file_ph, std::ios_base::openmode mode );
basic_filebuf<charT,traits> *
open( const wpath & file_ph, std::ios_base::openmode mode );
# endif
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
basic_filebuf<charT,traits> *
open( const path & file_ph, std::ios_base::openmode mode );
# endif
};
template < class charT, class traits = std::char_traits<charT> >
class basic_ifstream : public std::basic_ifstream<charT,traits>
{
private: // disallow copying
basic_ifstream( const basic_ifstream & );
const basic_ifstream & operator=( const basic_ifstream & );
public:
basic_ifstream() {}
// use two signatures, rather than one signature with default second
// argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
template<class Path>
explicit basic_ifstream( const Path & file_ph,
typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
template<class Path>
basic_ifstream( const Path & file_ph, std::ios_base::openmode mode,
typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
template<class Path>
typename boost::enable_if<is_basic_path<Path>, void>::type
open( const Path & file_ph );
template<class Path>
typename boost::enable_if<is_basic_path<Path>, void>::type
open( const Path & file_ph, std::ios_base::openmode mode );
explicit basic_ifstream( const wpath & file_ph );
basic_ifstream( const wpath & file_ph, std::ios_base::openmode mode );
void open( const wpath & file_ph );
void open( const wpath & file_ph, std::ios_base::openmode mode );
# endif
explicit basic_ifstream( const path & file_ph );
basic_ifstream( const path & file_ph, std::ios_base::openmode mode );
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
void open( const path & file_ph );
void open( const path & file_ph, std::ios_base::openmode mode );
# endif
virtual ~basic_ifstream() {}
};
template < class charT, class traits = std::char_traits<charT> >
class basic_ofstream : public std::basic_ofstream<charT,traits>
{
private: // disallow copying
basic_ofstream( const basic_ofstream & );
const basic_ofstream & operator=( const basic_ofstream & );
public:
basic_ofstream() {}
// use two signatures, rather than one signature with default second
// argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
template<class Path>
explicit basic_ofstream( const Path & file_ph,
typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
explicit basic_ofstream( const wpath & file_ph );
template<class Path>
basic_ofstream( const Path & file_ph, std::ios_base::openmode mode,
typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
basic_ofstream( const wpath & file_ph, std::ios_base::openmode mode );
template<class Path>
typename boost::enable_if<is_basic_path<Path>, void>::type
open( const Path & file_ph );
void open( const wpath & file_ph );
template<class Path>
typename boost::enable_if<is_basic_path<Path>, void>::type
open( const Path & file_ph, std::ios_base::openmode mode );
void open( const wpath & file_ph, std::ios_base::openmode mode );
# endif
explicit basic_ofstream( const path & file_ph );
basic_ofstream( const path & file_ph, std::ios_base::openmode mode );
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
void open( const path & file_ph );
void open( const path & file_ph, std::ios_base::openmode mode );
# endif
virtual ~basic_ofstream() {}
};
template < class charT, class traits = std::char_traits<charT> >
class basic_fstream : public std::basic_fstream<charT,traits>
{
private: // disallow copying
basic_fstream( const basic_fstream & );
const basic_fstream & operator=( const basic_fstream & );
public:
basic_fstream() {}
// use two signatures, rather than one signature with default second
// argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
template<class Path>
explicit basic_fstream( const Path & file_ph,
typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
explicit basic_fstream( const wpath & file_ph );
template<class Path>
basic_fstream( const Path & file_ph, std::ios_base::openmode mode,
typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
basic_fstream( const wpath & file_ph, std::ios_base::openmode mode );
template<class Path>
typename boost::enable_if<is_basic_path<Path>, void>::type
open( const Path & file_ph );
void open( const wpath & file_ph );
template<class Path>
typename boost::enable_if<is_basic_path<Path>, void>::type
open( const Path & file_ph, std::ios_base::openmode mode );
void open( const wpath & file_ph, std::ios_base::openmode mode );
# endif
explicit basic_fstream( const path & file_ph );
basic_fstream( const path & file_ph, std::ios_base::openmode mode );
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
void open( const path & file_ph );
void open( const path & file_ph, std::ios_base::openmode mode );
# endif
virtual ~basic_fstream() {}
};
typedef basic_filebuf<char> filebuf;
typedef basic_ifstream<char> ifstream;
typedef basic_ofstream<char> ofstream;
typedef basic_fstream<char> fstream;
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
typedef basic_filebuf<wchar_t> wfilebuf;
typedef basic_ifstream<wchar_t> wifstream;
typedef basic_fstream<wchar_t> wfstream;
typedef basic_ofstream<wchar_t> wofstream;
# endif
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
// basic_filebuf definitions -----------------------------------------------//
template <class charT, class traits>
template<class Path>
typename boost::enable_if<is_basic_path<Path>,
basic_filebuf<charT,traits> *>::type
basic_filebuf<charT,traits>::open( const Path & file_ph,
std::ios_base::openmode mode )
{
return (std::basic_filebuf<charT,traits>::open( detail::path_proxy(
file_ph.external_file_string(), mode ).c_str(), mode )
== 0) ? 0 : this;
} }
};
template <class charT, class traits> //--------------------------------------------------------------------------------------//
basic_filebuf<charT,traits> * // basic_ifstream //
basic_filebuf<charT, traits>::open( const wpath & file_ph, //--------------------------------------------------------------------------------------//
std::ios_base::openmode mode )
{
return this->BOOST_NESTED_TEMPLATE open<wpath>( file_ph, mode );
}
// basic_ifstream definitions ----------------------------------------------// template < class charT, class traits = std::char_traits<charT> >
class basic_ifstream : public std::basic_ifstream<charT,traits>
{
private: // disallow copying
basic_ifstream(const basic_ifstream&);
const basic_ifstream& operator=(const basic_ifstream&);
template <class charT, class traits> template<class Path> public:
basic_ifstream<charT,traits>::basic_ifstream(const Path & file_ph, basic_ifstream() {}
typename boost::enable_if<is_basic_path<Path> >::type* )
: std::basic_ifstream<charT,traits>(
detail::path_proxy( file_ph.external_file_string(),
std::ios_base::in ).c_str(), std::ios_base::in ) {}
template <class charT, class traits> // use two signatures, rather than one signature with default second
basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph ) // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
: std::basic_ifstream<charT,traits>(
detail::path_proxy( file_ph.external_file_string(),
std::ios_base::in ).c_str(), std::ios_base::in ) {}
template <class charT, class traits> template<class Path>
basic_ifstream<charT,traits>::basic_ifstream( const Path & file_ph,
std::ios_base::openmode mode,
typename boost::enable_if<is_basic_path<Path> >::type* )
: std::basic_ifstream<charT,traits>(
detail::path_proxy( file_ph.external_file_string(),
mode ).c_str(), mode | std::ios_base::in ) {}
template <class charT, class traits> explicit basic_ifstream(const path& p)
basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph, : std::basic_ifstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, std::ios_base::in) {}
std::ios_base::openmode mode )
: std::basic_ifstream<charT,traits>(
detail::path_proxy( file_ph.external_file_string(),
mode ).c_str(), mode | std::ios_base::in ) {}
template <class charT, class traits> template<class Path> basic_ifstream(const path& p, std::ios_base::openmode mode)
typename boost::enable_if<is_basic_path<Path>, void>::type : std::basic_ifstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, mode) {}
basic_ifstream<charT,traits>::open( const Path & file_ph )
{
std::basic_ifstream<charT,traits>::open(
detail::path_proxy( file_ph.external_file_string(),
std::ios_base::in ).c_str(), std::ios_base::in );
}
template <class charT, class traits> void open(const path& p)
void basic_ifstream<charT,traits>::open( const wpath & file_ph ) { std::basic_ifstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, std::ios_base::in); }
{
std::basic_ifstream<charT,traits>::open(
detail::path_proxy( file_ph.external_file_string(),
std::ios_base::in ).c_str(), std::ios_base::in );
}
template <class charT, class traits> template<class Path>
typename boost::enable_if<is_basic_path<Path>, void>::type
basic_ifstream<charT,traits>::open( const Path & file_ph,
std::ios_base::openmode mode )
{
std::basic_ifstream<charT,traits>::open(
detail::path_proxy( file_ph.external_file_string(),
mode ).c_str(), mode | std::ios_base::in );
}
template <class charT, class traits>
void basic_ifstream<charT,traits>::open( const wpath & file_ph,
std::ios_base::openmode mode )
{
std::basic_ifstream<charT,traits>::open(
detail::path_proxy( file_ph.external_file_string(),
mode ).c_str(), mode | std::ios_base::in );
}
// basic_ofstream definitions ----------------------------------------------// void open(const path& p, std::ios_base::openmode mode)
{ std::basic_ifstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, mode); }
template <class charT, class traits> template<class Path> virtual ~basic_ifstream() {}
basic_ofstream<charT,traits>::basic_ofstream(const Path & file_ph, };
typename boost::enable_if<is_basic_path<Path> >::type* )
: std::basic_ofstream<charT,traits>(
detail::path_proxy( file_ph.external_file_string(),
std::ios_base::out ).c_str(), std::ios_base::out ) {}
template <class charT, class traits> //--------------------------------------------------------------------------------------//
basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph ) // basic_ofstream //
: std::basic_ofstream<charT,traits>( //--------------------------------------------------------------------------------------//
detail::path_proxy( file_ph.external_file_string(),
std::ios_base::out ).c_str(), std::ios_base::out ) {}
template <class charT, class traits> template<class Path> template < class charT, class traits = std::char_traits<charT> >
basic_ofstream<charT,traits>::basic_ofstream( const Path & file_ph, class basic_ofstream : public std::basic_ofstream<charT,traits>
std::ios_base::openmode mode, {
typename boost::enable_if<is_basic_path<Path> >::type* ) private: // disallow copying
: std::basic_ofstream<charT,traits>( basic_ofstream(const basic_ofstream&);
detail::path_proxy( file_ph.external_file_string(), const basic_ofstream& operator=(const basic_ofstream&);
mode ).c_str(), mode | std::ios_base::out ) {}
template <class charT, class traits> public:
basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph, basic_ofstream() {}
std::ios_base::openmode mode )
: std::basic_ofstream<charT,traits>(
detail::path_proxy( file_ph.external_file_string(),
mode ).c_str(), mode | std::ios_base::out ) {}
template <class charT, class traits> template<class Path>
typename boost::enable_if<is_basic_path<Path>, void>::type
basic_ofstream<charT,traits>::open( const Path & file_ph )
{
std::basic_ofstream<charT,traits>::open(
detail::path_proxy( file_ph.external_file_string(),
std::ios_base::out ).c_str(), std::ios_base::out );
}
template <class charT, class traits>
void basic_ofstream<charT,traits>::open( const wpath & file_ph )
{
std::basic_ofstream<charT,traits>::open(
detail::path_proxy( file_ph.external_file_string(),
std::ios_base::out ).c_str(), std::ios_base::out );
}
template <class charT, class traits> template<class Path>
typename boost::enable_if<is_basic_path<Path>, void>::type
basic_ofstream<charT,traits>::open( const Path & file_ph,
std::ios_base::openmode mode )
{
std::basic_ofstream<charT,traits>::open(
detail::path_proxy( file_ph.external_file_string(),
mode ).c_str(), mode | std::ios_base::out );
}
template <class charT, class traits> // use two signatures, rather than one signature with default second
void basic_ofstream<charT,traits>::open( const wpath & file_ph, // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
std::ios_base::openmode mode )
{
std::basic_ofstream<charT,traits>::open(
detail::path_proxy( file_ph.external_file_string(),
mode ).c_str(), mode | std::ios_base::out );
}
// basic_fstream definitions -----------------------------------------------// explicit basic_ofstream(const path& p)
: std::basic_ofstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, std::ios_base::out) {}
template <class charT, class traits> template<class Path> basic_ofstream(const path& p, std::ios_base::openmode mode)
basic_fstream<charT,traits>::basic_fstream(const Path & file_ph, : std::basic_ofstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, mode) {}
typename boost::enable_if<is_basic_path<Path> >::type* )
: std::basic_fstream<charT,traits>(
detail::path_proxy( file_ph.external_file_string(),
std::ios_base::in|std::ios_base::out ).c_str(),
std::ios_base::in|std::ios_base::out ) {}
template <class charT, class traits> void open(const path& p)
basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph ) { std::basic_ofstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, std::ios_base::out); }
: std::basic_fstream<charT,traits>(
detail::path_proxy( file_ph.external_file_string(),
std::ios_base::in|std::ios_base::out ).c_str(),
std::ios_base::in|std::ios_base::out ) {}
template <class charT, class traits> template<class Path> void open(const path& p, std::ios_base::openmode mode)
basic_fstream<charT,traits>::basic_fstream( const Path & file_ph, { std::basic_ofstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, mode); }
std::ios_base::openmode mode,
typename boost::enable_if<is_basic_path<Path> >::type* )
: std::basic_fstream<charT,traits>(
detail::path_proxy( file_ph.external_file_string(),
mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {}
template <class charT, class traits>
basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph,
std::ios_base::openmode mode )
: std::basic_fstream<charT,traits>(
detail::path_proxy( file_ph.external_file_string(),
mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {}
template <class charT, class traits> template<class Path>
typename boost::enable_if<is_basic_path<Path>, void>::type
basic_fstream<charT,traits>::open( const Path & file_ph )
{
std::basic_fstream<charT,traits>::open(
detail::path_proxy( file_ph.external_file_string(),
std::ios_base::in|std::ios_base::out ).c_str(),
std::ios_base::in|std::ios_base::out );
}
template <class charT, class traits> virtual ~basic_ofstream() {}
void basic_fstream<charT,traits>::open( const wpath & file_ph ) };
{
std::basic_fstream<charT,traits>::open(
detail::path_proxy( file_ph.external_file_string(),
std::ios_base::in|std::ios_base::out ).c_str(),
std::ios_base::in|std::ios_base::out );
}
template <class charT, class traits> template<class Path>
typename boost::enable_if<is_basic_path<Path>, void>::type
basic_fstream<charT,traits>::open( const Path & file_ph,
std::ios_base::openmode mode )
{
std::basic_fstream<charT,traits>::open(
detail::path_proxy( file_ph.external_file_string(),
mode ).c_str(), mode | std::ios_base::in | std::ios_base::out );
}
template <class charT, class traits> //--------------------------------------------------------------------------------------//
void basic_fstream<charT,traits>::open( const wpath & file_ph, // basic_fstream //
std::ios_base::openmode mode ) //--------------------------------------------------------------------------------------//
{
std::basic_fstream<charT,traits>::open(
detail::path_proxy( file_ph.external_file_string(),
mode ).c_str(), mode | std::ios_base::in | std::ios_base::out );
}
# endif template < class charT, class traits = std::char_traits<charT> >
class basic_fstream : public std::basic_fstream<charT,traits>
{
private: // disallow copying
basic_fstream(const basic_fstream&);
const basic_fstream & operator=(const basic_fstream&);
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this public:
template <class charT, class traits> basic_fstream() {}
basic_filebuf<charT,traits> *
basic_filebuf<charT, traits>::open( const path & file_ph,
std::ios_base::openmode mode )
{
return std::basic_filebuf<charT,traits>::open(
file_ph.file_string().c_str(), mode ) == 0 ? 0 : this;
}
# endif
template <class charT, class traits> // use two signatures, rather than one signature with default second
basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph ) // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
: std::basic_ifstream<charT,traits>(
file_ph.file_string().c_str(), std::ios_base::in ) {}
template <class charT, class traits> explicit basic_fstream(const path& p)
basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph, : std::basic_fstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR,
std::ios_base::openmode mode ) std::ios_base::in | std::ios_base::out) {}
: std::basic_ifstream<charT,traits>(
file_ph.file_string().c_str(), mode ) {}
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
template <class charT, class traits>
void basic_ifstream<charT,traits>::open( const path & file_ph )
{
std::basic_ifstream<charT,traits>::open(
file_ph.file_string().c_str(), std::ios_base::in );
}
template <class charT, class traits>
void basic_ifstream<charT,traits>::open( const path & file_ph,
std::ios_base::openmode mode )
{
std::basic_ifstream<charT,traits>::open(
file_ph.file_string().c_str(), mode );
}
# endif
template <class charT, class traits> basic_fstream(const path& p, std::ios_base::openmode mode)
basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph ) : std::basic_fstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, mode) {}
: std::basic_ofstream<charT,traits>(
file_ph.file_string().c_str(), std::ios_base::out ) {}
template <class charT, class traits> void open(const path& p)
basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph, { std::basic_fstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR,
std::ios_base::openmode mode ) std::ios_base::in | std::ios_base::out); }
: std::basic_ofstream<charT,traits>(
file_ph.file_string().c_str(), mode ) {}
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
template <class charT, class traits>
void basic_ofstream<charT,traits>::open( const path & file_ph )
{
std::basic_ofstream<charT,traits>::open(
file_ph.file_string().c_str(), std::ios_base::out );
}
template <class charT, class traits>
void basic_ofstream<charT,traits>::open( const path & file_ph,
std::ios_base::openmode mode )
{
std::basic_ofstream<charT,traits>::open(
file_ph.file_string().c_str(), mode );
}
# endif
template <class charT, class traits> void open(const path& p, std::ios_base::openmode mode)
basic_fstream<charT,traits>::basic_fstream( const path & file_ph ) { std::basic_fstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, mode); }
: std::basic_fstream<charT,traits>(
file_ph.file_string().c_str(),
std::ios_base::in|std::ios_base::out ) {}
virtual ~basic_fstream() {}
template <class charT, class traits> };
basic_fstream<charT,traits>::basic_fstream( const path & file_ph,
std::ios_base::openmode mode )
: std::basic_fstream<charT,traits>(
file_ph.file_string().c_str(), mode ) {}
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this //--------------------------------------------------------------------------------------//
template <class charT, class traits> // typedefs //
void basic_fstream<charT,traits>::open( const path & file_ph ) //--------------------------------------------------------------------------------------//
{
std::basic_fstream<charT,traits>::open(
file_ph.file_string().c_str(), std::ios_base::in|std::ios_base::out );
}
template <class charT, class traits> typedef basic_filebuf<char> filebuf;
void basic_fstream<charT,traits>::open( const path & file_ph, typedef basic_ifstream<char> ifstream;
std::ios_base::openmode mode ) typedef basic_ofstream<char> ofstream;
{ typedef basic_fstream<char> fstream;
std::basic_fstream<charT,traits>::open(
file_ph.file_string().c_str(), mode ); typedef basic_filebuf<wchar_t> wfilebuf;
} typedef basic_ifstream<wchar_t> wifstream;
# endif typedef basic_ofstream<wchar_t> wofstream;
} // namespace filesystem typedef basic_fstream<wchar_t> wfstream;
} // namespace filesystem
} // namespace boost } // namespace boost
#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas #include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
#endif // BOOST_FILESYSTEM_FSTREAM_HPP #endif // BOOST_FILESYSTEM3_FSTREAM_HPP

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,235 @@
// filesystem path_traits.hpp --------------------------------------------------------//
// Copyright Beman Dawes 2009
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
// Library home page: http://www.boost.org/libs/filesystem
#ifndef BOOST_FILESYSTEM_PATH_TRAITS_HPP
#define BOOST_FILESYSTEM_PATH_TRAITS_HPP
#include <boost/config.hpp>
# if defined( BOOST_NO_STD_WSTRING )
# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
# endif
#include <boost/filesystem/config.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/decay.hpp>
#include <boost/system/error_code.hpp>
#include <cwchar> // for mbstate_t
#include <string>
#include <vector>
#include <list>
#include <iterator>
#include <locale>
#include <boost/assert.hpp>
// #include <iostream> //**** comment me out ****
#include <boost/config/abi_prefix.hpp> // must be the last #include
namespace boost { namespace filesystem {
BOOST_FILESYSTEM_DECL const system::error_category& codecvt_error_category();
// uses std::codecvt_base::result used for error codes:
//
// ok: Conversion successful.
// partial: Not all source characters converted; one or more additional source
// characters are needed to produce the final target character, or the
// size of the target intermediate buffer was too small to hold the result.
// error: A character in the source could not be converted to the target encoding.
// noconv: The source and target characters have the same type and encoding, so no
// conversion was necessary.
class directory_entry;
namespace path_traits {
typedef std::codecvt<wchar_t, char, std::mbstate_t> codecvt_type;
// is_pathable type trait; allows disabling over-agressive class path member templates
template <class T>
struct is_pathable { static const bool value = false; };
template<> struct is_pathable<char*> { static const bool value = true; };
template<> struct is_pathable<const char*> { static const bool value = true; };
template<> struct is_pathable<wchar_t*> { static const bool value = true; };
template<> struct is_pathable<const wchar_t*> { static const bool value = true; };
template<> struct is_pathable<std::string> { static const bool value = true; };
template<> struct is_pathable<std::wstring> { static const bool value = true; };
template<> struct is_pathable<std::vector<char> > { static const bool value = true; };
template<> struct is_pathable<std::vector<wchar_t> > { static const bool value = true; };
template<> struct is_pathable<std::list<char> > { static const bool value = true; };
template<> struct is_pathable<std::list<wchar_t> > { static const bool value = true; };
template<> struct is_pathable<directory_entry> { static const bool value = true; };
// Pathable empty
template <class Container> inline
// disable_if aids broken compilers (IBM, old GCC, etc.) and is harmless for
// conforming compilers. Replace by plain "bool" at some future date (2012?)
typename boost::disable_if<boost::is_array<Container>, bool>::type
empty(const Container & c)
{ return c.begin() == c.end(); }
template <class T> inline
bool empty(T * const & c_str)
{
BOOST_ASSERT(c_str);
return !*c_str;
}
template <typename T, size_t N> inline
bool empty(T (&x)[N])
{ return !x[0]; }
// value types differ ---------------------------------------------------------------//
//
// A from_end argument of 0 is less efficient than a known end, so use only if needed
BOOST_FILESYSTEM_DECL
void convert(const char* from,
const char* from_end, // 0 for null terminated MBCS
std::wstring & to,
const codecvt_type& cvt);
BOOST_FILESYSTEM_DECL
void convert(const wchar_t* from,
const wchar_t* from_end, // 0 for null terminated MBCS
std::string & to,
const codecvt_type& cvt);
inline
void convert(const char* from,
std::wstring & to,
const codecvt_type& cvt)
{
BOOST_ASSERT(from);
convert(from, 0, to, cvt);
}
inline
void convert(const wchar_t* from,
std::string & to,
const codecvt_type& cvt)
{
BOOST_ASSERT(from);
convert(from, 0, to, cvt);
}
// value types same -----------------------------------------------------------------//
// char
inline
void convert(const char* from, const char* from_end, std::string & to,
const codecvt_type&)
{
BOOST_ASSERT(from);
BOOST_ASSERT(from_end);
to.append(from, from_end);
}
inline
void convert(const char* from,
std::string & to,
const codecvt_type&)
{
BOOST_ASSERT(from);
to += from;
}
// wchar_t
inline
void convert(const wchar_t* from, const wchar_t* from_end, std::wstring & to,
const codecvt_type&)
{
BOOST_ASSERT(from);
BOOST_ASSERT(from_end);
to.append(from, from_end);
}
inline
void convert(const wchar_t* from,
std::wstring & to,
const codecvt_type&)
{
BOOST_ASSERT(from);
to += from;
}
// Source dispatch -----------------------------------------------------------------//
// contiguous containers
template <class U> inline
void dispatch(const std::string& c, U& to, const codecvt_type& cvt)
{
if (c.size())
convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
}
template <class U> inline
void dispatch(const std::wstring& c, U& to, const codecvt_type& cvt)
{
if (c.size())
convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
}
template <class U> inline
void dispatch(const std::vector<char>& c, U& to, const codecvt_type& cvt)
{
if (c.size())
convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
}
template <class U> inline
void dispatch(const std::vector<wchar_t>& c, U& to, const codecvt_type& cvt)
{
if (c.size())
convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
}
// non-contiguous containers
template <class Container, class U> inline
// disable_if aids broken compilers (IBM, old GCC, etc.) and is harmless for
// conforming compilers. Replace by plain "void" at some future date (2012?)
typename boost::disable_if<boost::is_array<Container>, void>::type
dispatch(const Container & c, U& to, const codecvt_type& cvt)
{
if (c.size())
{
std::basic_string<typename Container::value_type> s(c.begin(), c.end());
convert(s.c_str(), s.c_str()+s.size(), to, cvt);
}
}
// c_str
template <class T, class U> inline
void dispatch(T * const & c_str, U& to, const codecvt_type& cvt)
{
// std::cout << "dispatch() const T *\n";
BOOST_ASSERT(c_str);
convert(c_str, to, cvt);
}
// Note: there is no dispatch on C-style arrays because the array may
// contain a string smaller than the array size.
BOOST_FILESYSTEM_DECL
void dispatch(const directory_entry & de,
# ifdef BOOST_WINDOWS_API
std::wstring & to,
# else
std::string & to,
# endif
const codecvt_type&);
}}} // namespace boost::filesystem::path_traits
#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
#endif // BOOST_FILESYSTEM_PATH_TRAITS_HPP

View File

@ -0,0 +1,40 @@
// Copyright 2005-2009 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)
// Based on Peter Dimov's proposal
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
// issue 6.18.
#if !defined(BOOST_FUNCTIONAL_HASH_FWD_HPP)
#define BOOST_FUNCTIONAL_HASH_FWD_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include <boost/config.hpp>
#include <cstddef>
#include <boost/detail/workaround.hpp>
namespace boost
{
template <class T> struct hash;
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
template <class T> void hash_combine(std::size_t& seed, T& v);
#else
template <class T> void hash_combine(std::size_t& seed, T const& v);
#endif
template <class It> std::size_t hash_range(It, It);
template <class It> void hash_range(std::size_t&, It, It);
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
template <class T> inline std::size_t hash_range(T*, T*);
template <class T> inline void hash_range(std::size_t&, T*, T*);
#endif
}
#endif

View File

@ -0,0 +1,7 @@
// Copyright 2005-2009 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)
#include <boost/functional/hash/hash_fwd.hpp>

View File

@ -0,0 +1,190 @@
// boost/io/quoted_manip.hpp ---------------------------------------------------------//
// Copyright Beman Dawes 2010
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
// Library home page http://www.boost.org/libs/io
//--------------------------------------------------------------------------------------//
#ifndef BOOST_IO_QUOTED_MANIP
#define BOOST_IO_QUOTED_MANIP
#include <iosfwd>
#include <ios>
#include <string>
#include <iterator>
#include <boost/io/ios_state.hpp>
namespace boost
{
namespace io
{
namespace detail { template <class String, class Char> struct quoted_proxy; }
// ------------ public interface ------------------------------------------------//
// manipulator for const std::basic_string&
template <class Char, class Traits, class Alloc>
detail::quoted_proxy<std::basic_string<Char, Traits, Alloc> const &, Char>
quoted(const std::basic_string<Char, Traits, Alloc>& s,
Char escape='\\', Char delim='\"');
// manipulator for non-const std::basic_string&
template <class Char, class Traits, class Alloc>
detail::quoted_proxy<std::basic_string<Char, Traits, Alloc> &, Char>
quoted(std::basic_string<Char, Traits, Alloc>& s,
Char escape='\\', Char delim='\"');
// manipulator for const C-string*
template <class Char>
detail::quoted_proxy<const Char*, Char>
quoted(const Char* s, Char escape='\\', Char delim='\"');
// ----------- implementation details -------------------------------------------//
namespace detail
{
// proxy used as an argument pack
template <class String, class Char>
struct quoted_proxy
{
String string;
Char escape;
Char delim;
quoted_proxy(String s_, Char escape_, Char delim_)
: string(s_), escape(escape_), delim(delim_) {}
private:
// String may be a const type, so disable the assignment operator
quoted_proxy& operator=(const quoted_proxy&); // = deleted
};
// abstract away difference between proxies with const or non-const basic_strings
template <class Char, class Traits, class Alloc>
std::basic_ostream<Char, Traits>&
basic_string_inserter_imp(std::basic_ostream<Char, Traits>& os,
std::basic_string<Char, Traits, Alloc> const & string, Char escape, Char delim)
{
os << delim;
typename std::basic_string<Char, Traits, Alloc>::const_iterator
end_it = string.end();
for (typename std::basic_string<Char, Traits, Alloc>::const_iterator
it = string.begin();
it != end_it;
++it )
{
if (*it == delim || *it == escape)
os << escape;
os << *it;
}
os << delim;
return os;
}
// inserter for const std::basic_string& proxies
template <class Char, class Traits, class Alloc>
inline
std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os,
const quoted_proxy<std::basic_string<Char, Traits, Alloc> const &, Char>& proxy)
{
return basic_string_inserter_imp(os, proxy.string, proxy.escape, proxy.delim);
}
// inserter for non-const std::basic_string& proxies
template <class Char, class Traits, class Alloc>
inline
std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os,
const quoted_proxy<std::basic_string<Char, Traits, Alloc>&, Char>& proxy)
{
return basic_string_inserter_imp(os, proxy.string, proxy.escape, proxy.delim);
}
// inserter for const C-string* proxies
template <class Char, class Traits>
std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os,
const quoted_proxy<const Char*, Char>& proxy)
{
os << proxy.delim;
for (const Char* it = proxy.string;
*it;
++it )
{
if (*it == proxy.delim || *it == proxy.escape)
os << proxy.escape;
os << *it;
}
os << proxy.delim;
return os;
}
// extractor for non-const std::basic_string& proxies
template <class Char, class Traits, class Alloc>
std::basic_istream<Char, Traits>& operator>>(std::basic_istream<Char, Traits>& is,
const quoted_proxy<std::basic_string<Char, Traits, Alloc>&, Char>& proxy)
{
proxy.string.clear();
Char c;
is >> c;
if (c != proxy.delim)
{
is.unget();
is >> proxy.string;
return is;
}
{
boost::io::ios_flags_saver ifs(is);
is >> std::noskipws;
for (;;)
{
is >> c;
if (!is.good()) // cope with I/O errors or end-of-file
break;
if (c == proxy.escape)
{
is >> c;
if (!is.good()) // cope with I/O errors or end-of-file
break;
}
else if (c == proxy.delim)
break;
proxy.string += c;
}
}
return is;
}
} // namespace detail
// manipulator implementation for const std::basic_string&
template <class Char, class Traits, class Alloc>
inline detail::quoted_proxy<std::basic_string<Char, Traits, Alloc> const &, Char>
quoted(const std::basic_string<Char, Traits, Alloc>& s, Char escape, Char delim)
{
return detail::quoted_proxy<std::basic_string<Char, Traits, Alloc> const &, Char>
(s, escape, delim);
}
// manipulator implementation for non-const std::basic_string&
template <class Char, class Traits, class Alloc>
inline detail::quoted_proxy<std::basic_string<Char, Traits, Alloc> &, Char>
quoted(std::basic_string<Char, Traits, Alloc>& s, Char escape, Char delim)
{
return detail::quoted_proxy<std::basic_string<Char, Traits, Alloc>&, Char>
(s, escape, delim);
}
// manipulator implementation for const C-string*
template <class Char>
inline detail::quoted_proxy<const Char*, Char>
quoted(const Char* s, Char escape, Char delim)
{
return detail::quoted_proxy<const Char*, Char> (s, escape, delim);
}
} // namespace io
} // namespace boost
#endif // BOOST_IO_QUOTED_MANIP

View File

@ -0,0 +1,439 @@
// Boost io/ios_state.hpp header file --------------------------------------//
// Copyright 2002, 2005 Daryle Walker. Use, modification, and distribution
// are subject to the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)
// See <http://www.boost.org/libs/io/> for the library's home page.
#ifndef BOOST_IO_IOS_STATE_HPP
#define BOOST_IO_IOS_STATE_HPP
#include <boost/io_fwd.hpp> // self include
#include <boost/detail/workaround.hpp>
#include <ios> // for std::ios_base, std::basic_ios, etc.
#ifndef BOOST_NO_STD_LOCALE
#include <locale> // for std::locale
#endif
#include <ostream> // for std::basic_ostream
#include <streambuf> // for std::basic_streambuf
#include <string> // for std::char_traits
namespace boost
{
namespace io
{
// Basic stream state saver class declarations -----------------------------//
class ios_flags_saver
{
public:
typedef ::std::ios_base state_type;
typedef ::std::ios_base::fmtflags aspect_type;
explicit ios_flags_saver( state_type &s )
: s_save_( s ), a_save_( s.flags() )
{}
ios_flags_saver( state_type &s, aspect_type const &a )
: s_save_( s ), a_save_( s.flags(a) )
{}
~ios_flags_saver()
{ this->restore(); }
void restore()
{ s_save_.flags( a_save_ ); }
private:
state_type & s_save_;
aspect_type const a_save_;
ios_flags_saver& operator=(const ios_flags_saver&);
};
class ios_precision_saver
{
public:
typedef ::std::ios_base state_type;
typedef ::std::streamsize aspect_type;
explicit ios_precision_saver( state_type &s )
: s_save_( s ), a_save_( s.precision() )
{}
ios_precision_saver( state_type &s, aspect_type const &a )
: s_save_( s ), a_save_( s.precision(a) )
{}
~ios_precision_saver()
{ this->restore(); }
void restore()
{ s_save_.precision( a_save_ ); }
private:
state_type & s_save_;
aspect_type const a_save_;
ios_precision_saver& operator=(const ios_precision_saver&);
};
class ios_width_saver
{
public:
typedef ::std::ios_base state_type;
typedef ::std::streamsize aspect_type;
explicit ios_width_saver( state_type &s )
: s_save_( s ), a_save_( s.width() )
{}
ios_width_saver( state_type &s, aspect_type const &a )
: s_save_( s ), a_save_( s.width(a) )
{}
~ios_width_saver()
{ this->restore(); }
void restore()
{ s_save_.width( a_save_ ); }
private:
state_type & s_save_;
aspect_type const a_save_;
ios_width_saver& operator=(const ios_width_saver&);
};
// Advanced stream state saver class template declarations -----------------//
template < typename Ch, class Tr >
class basic_ios_iostate_saver
{
public:
typedef ::std::basic_ios<Ch, Tr> state_type;
typedef ::std::ios_base::iostate aspect_type;
explicit basic_ios_iostate_saver( state_type &s )
: s_save_( s ), a_save_( s.rdstate() )
{}
basic_ios_iostate_saver( state_type &s, aspect_type const &a )
: s_save_( s ), a_save_( s.rdstate() )
{ s.clear(a); }
~basic_ios_iostate_saver()
{ this->restore(); }
void restore()
{ s_save_.clear( a_save_ ); }
private:
state_type & s_save_;
aspect_type const a_save_;
basic_ios_iostate_saver& operator=(const basic_ios_iostate_saver&);
};
template < typename Ch, class Tr >
class basic_ios_exception_saver
{
public:
typedef ::std::basic_ios<Ch, Tr> state_type;
typedef ::std::ios_base::iostate aspect_type;
explicit basic_ios_exception_saver( state_type &s )
: s_save_( s ), a_save_( s.exceptions() )
{}
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
basic_ios_exception_saver( state_type &s, aspect_type a )
#else
basic_ios_exception_saver( state_type &s, aspect_type const &a )
#endif
: s_save_( s ), a_save_( s.exceptions() )
{ s.exceptions(a); }
~basic_ios_exception_saver()
{ this->restore(); }
void restore()
{ s_save_.exceptions( a_save_ ); }
private:
state_type & s_save_;
aspect_type const a_save_;
basic_ios_exception_saver& operator=(const basic_ios_exception_saver&);
};
template < typename Ch, class Tr >
class basic_ios_tie_saver
{
public:
typedef ::std::basic_ios<Ch, Tr> state_type;
typedef ::std::basic_ostream<Ch, Tr> * aspect_type;
explicit basic_ios_tie_saver( state_type &s )
: s_save_( s ), a_save_( s.tie() )
{}
basic_ios_tie_saver( state_type &s, aspect_type const &a )
: s_save_( s ), a_save_( s.tie(a) )
{}
~basic_ios_tie_saver()
{ this->restore(); }
void restore()
{ s_save_.tie( a_save_ ); }
private:
state_type & s_save_;
aspect_type const a_save_;
basic_ios_tie_saver& operator=(const basic_ios_tie_saver&);
};
template < typename Ch, class Tr >
class basic_ios_rdbuf_saver
{
public:
typedef ::std::basic_ios<Ch, Tr> state_type;
typedef ::std::basic_streambuf<Ch, Tr> * aspect_type;
explicit basic_ios_rdbuf_saver( state_type &s )
: s_save_( s ), a_save_( s.rdbuf() )
{}
basic_ios_rdbuf_saver( state_type &s, aspect_type const &a )
: s_save_( s ), a_save_( s.rdbuf(a) )
{}
~basic_ios_rdbuf_saver()
{ this->restore(); }
void restore()
{ s_save_.rdbuf( a_save_ ); }
private:
state_type & s_save_;
aspect_type const a_save_;
basic_ios_rdbuf_saver& operator=(const basic_ios_rdbuf_saver&);
};
template < typename Ch, class Tr >
class basic_ios_fill_saver
{
public:
typedef ::std::basic_ios<Ch, Tr> state_type;
typedef typename state_type::char_type aspect_type;
explicit basic_ios_fill_saver( state_type &s )
: s_save_( s ), a_save_( s.fill() )
{}
basic_ios_fill_saver( state_type &s, aspect_type const &a )
: s_save_( s ), a_save_( s.fill(a) )
{}
~basic_ios_fill_saver()
{ this->restore(); }
void restore()
{ s_save_.fill( a_save_ ); }
private:
state_type & s_save_;
aspect_type const a_save_;
basic_ios_fill_saver& operator=(const basic_ios_fill_saver&);
};
#ifndef BOOST_NO_STD_LOCALE
template < typename Ch, class Tr >
class basic_ios_locale_saver
{
public:
typedef ::std::basic_ios<Ch, Tr> state_type;
typedef ::std::locale aspect_type;
explicit basic_ios_locale_saver( state_type &s )
: s_save_( s ), a_save_( s.getloc() )
{}
basic_ios_locale_saver( state_type &s, aspect_type const &a )
: s_save_( s ), a_save_( s.imbue(a) )
{}
~basic_ios_locale_saver()
{ this->restore(); }
void restore()
{ s_save_.imbue( a_save_ ); }
private:
state_type & s_save_;
aspect_type const a_save_;
basic_ios_locale_saver& operator=(const basic_ios_locale_saver&);
};
#endif
// User-defined stream state saver class declarations ----------------------//
class ios_iword_saver
{
public:
typedef ::std::ios_base state_type;
typedef int index_type;
typedef long aspect_type;
explicit ios_iword_saver( state_type &s, index_type i )
: s_save_( s ), a_save_( s.iword(i) ), i_save_( i )
{}
ios_iword_saver( state_type &s, index_type i, aspect_type const &a )
: s_save_( s ), a_save_( s.iword(i) ), i_save_( i )
{ s.iword(i) = a; }
~ios_iword_saver()
{ this->restore(); }
void restore()
{ s_save_.iword( i_save_ ) = a_save_; }
private:
state_type & s_save_;
aspect_type const a_save_;
index_type const i_save_;
ios_iword_saver& operator=(const ios_iword_saver&);
};
class ios_pword_saver
{
public:
typedef ::std::ios_base state_type;
typedef int index_type;
typedef void * aspect_type;
explicit ios_pword_saver( state_type &s, index_type i )
: s_save_( s ), a_save_( s.pword(i) ), i_save_( i )
{}
ios_pword_saver( state_type &s, index_type i, aspect_type const &a )
: s_save_( s ), a_save_( s.pword(i) ), i_save_( i )
{ s.pword(i) = a; }
~ios_pword_saver()
{ this->restore(); }
void restore()
{ s_save_.pword( i_save_ ) = a_save_; }
private:
state_type & s_save_;
aspect_type const a_save_;
index_type const i_save_;
ios_pword_saver operator=(const ios_pword_saver&);
};
// Combined stream state saver class (template) declarations ---------------//
class ios_base_all_saver
{
public:
typedef ::std::ios_base state_type;
explicit ios_base_all_saver( state_type &s )
: s_save_( s ), a1_save_( s.flags() ), a2_save_( s.precision() )
, a3_save_( s.width() )
{}
~ios_base_all_saver()
{ this->restore(); }
void restore()
{
s_save_.width( a3_save_ );
s_save_.precision( a2_save_ );
s_save_.flags( a1_save_ );
}
private:
state_type & s_save_;
state_type::fmtflags const a1_save_;
::std::streamsize const a2_save_;
::std::streamsize const a3_save_;
ios_base_all_saver& operator=(const ios_base_all_saver&);
};
template < typename Ch, class Tr >
class basic_ios_all_saver
{
public:
typedef ::std::basic_ios<Ch, Tr> state_type;
explicit basic_ios_all_saver( state_type &s )
: s_save_( s ), a1_save_( s.flags() ), a2_save_( s.precision() )
, a3_save_( s.width() ), a4_save_( s.rdstate() )
, a5_save_( s.exceptions() ), a6_save_( s.tie() )
, a7_save_( s.rdbuf() ), a8_save_( s.fill() )
#ifndef BOOST_NO_STD_LOCALE
, a9_save_( s.getloc() )
#endif
{}
~basic_ios_all_saver()
{ this->restore(); }
void restore()
{
#ifndef BOOST_NO_STD_LOCALE
s_save_.imbue( a9_save_ );
#endif
s_save_.fill( a8_save_ );
s_save_.rdbuf( a7_save_ );
s_save_.tie( a6_save_ );
s_save_.exceptions( a5_save_ );
s_save_.clear( a4_save_ );
s_save_.width( a3_save_ );
s_save_.precision( a2_save_ );
s_save_.flags( a1_save_ );
}
private:
state_type & s_save_;
typename state_type::fmtflags const a1_save_;
::std::streamsize const a2_save_;
::std::streamsize const a3_save_;
typename state_type::iostate const a4_save_;
typename state_type::iostate const a5_save_;
::std::basic_ostream<Ch, Tr> * const a6_save_;
::std::basic_streambuf<Ch, Tr> * const a7_save_;
typename state_type::char_type const a8_save_;
#ifndef BOOST_NO_STD_LOCALE
::std::locale const a9_save_;
#endif
basic_ios_all_saver& operator=(const basic_ios_all_saver&);
};
class ios_all_word_saver
{
public:
typedef ::std::ios_base state_type;
typedef int index_type;
ios_all_word_saver( state_type &s, index_type i )
: s_save_( s ), i_save_( i ), a1_save_( s.iword(i) )
, a2_save_( s.pword(i) )
{}
~ios_all_word_saver()
{ this->restore(); }
void restore()
{
s_save_.pword( i_save_ ) = a2_save_;
s_save_.iword( i_save_ ) = a1_save_;
}
private:
state_type & s_save_;
index_type const i_save_;
long const a1_save_;
void * const a2_save_;
ios_all_word_saver& operator=(const ios_all_word_saver&);
};
} // namespace io
} // namespace boost
#endif // BOOST_IO_IOS_STATE_HPP

View File

@ -0,0 +1,67 @@
// Boost io_fwd.hpp header file --------------------------------------------//
// Copyright 2002 Daryle Walker. Use, modification, and distribution are subject
// to the Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)
// See <http://www.boost.org/libs/io/> for the library's home page.
#ifndef BOOST_IO_FWD_HPP
#define BOOST_IO_FWD_HPP
#include <iosfwd> // for std::char_traits (declaration)
namespace boost
{
namespace io
{
// From <boost/io/ios_state.hpp> -------------------------------------------//
class ios_flags_saver;
class ios_precision_saver;
class ios_width_saver;
class ios_base_all_saver;
template < typename Ch, class Tr = ::std::char_traits<Ch> >
class basic_ios_iostate_saver;
template < typename Ch, class Tr = ::std::char_traits<Ch> >
class basic_ios_exception_saver;
template < typename Ch, class Tr = ::std::char_traits<Ch> >
class basic_ios_tie_saver;
template < typename Ch, class Tr = ::std::char_traits<Ch> >
class basic_ios_rdbuf_saver;
template < typename Ch, class Tr = ::std::char_traits<Ch> >
class basic_ios_fill_saver;
template < typename Ch, class Tr = ::std::char_traits<Ch> >
class basic_ios_locale_saver;
template < typename Ch, class Tr = ::std::char_traits<Ch> >
class basic_ios_all_saver;
typedef basic_ios_iostate_saver<char> ios_iostate_saver;
typedef basic_ios_iostate_saver<wchar_t> wios_iostate_saver;
typedef basic_ios_exception_saver<char> ios_exception_saver;
typedef basic_ios_exception_saver<wchar_t> wios_exception_saver;
typedef basic_ios_tie_saver<char> ios_tie_saver;
typedef basic_ios_tie_saver<wchar_t> wios_tie_saver;
typedef basic_ios_rdbuf_saver<char> ios_rdbuf_saver;
typedef basic_ios_rdbuf_saver<wchar_t> wios_rdbuf_saver;
typedef basic_ios_fill_saver<char> ios_fill_saver;
typedef basic_ios_fill_saver<wchar_t> wios_fill_saver;
typedef basic_ios_locale_saver<char> ios_locale_saver;
typedef basic_ios_locale_saver<wchar_t> wios_locale_saver;
typedef basic_ios_all_saver<char> ios_all_saver;
typedef basic_ios_all_saver<wchar_t> wios_all_saver;
class ios_iword_saver;
class ios_pword_saver;
class ios_all_word_saver;
} // namespace io
} // namespace boost
#endif // BOOST_IO_FWD_HPP

View File

@ -1,4 +1,4 @@
// interator.hpp workarounds for non-conforming standard libraries ---------// // iterator.hpp workarounds for non-conforming standard libraries ---------//
// (C) Copyright Beman Dawes 2000. Distributed under the Boost // (C) Copyright Beman Dawes 2000. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file

View File

@ -24,15 +24,9 @@
#ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY #ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
# include <boost/type_traits/remove_reference.hpp> # include <boost/type_traits/remove_reference.hpp>
# if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
# include <boost/type_traits/add_reference.hpp>
# endif
#else
# include <boost/type_traits/add_reference.hpp>
#endif #endif
#include <boost/type_traits/add_reference.hpp>
#include <boost/iterator/detail/config_def.hpp> #include <boost/iterator/detail/config_def.hpp>
#include <boost/iterator/iterator_traits.hpp> #include <boost/iterator/iterator_traits.hpp>
@ -238,7 +232,7 @@ namespace boost
// versions of iterator_adaptor The idea is that when the user needs // versions of iterator_adaptor The idea is that when the user needs
// to fiddle with the reference type it is highly likely that the // to fiddle with the reference type it is highly likely that the
// iterator category has to be adjusted as well. Any of the // iterator category has to be adjusted as well. Any of the
// following four template arguments may be omitted or explicitly // following four template arguments may be ommitted or explicitly
// replaced by use_default. // replaced by use_default.
// //
// Value - if supplied, the value_type of the resulting iterator, unless // Value - if supplied, the value_type of the resulting iterator, unless

View File

@ -14,8 +14,8 @@
#include <boost/iterator/detail/facade_iterator_category.hpp> #include <boost/iterator/detail/facade_iterator_category.hpp>
#include <boost/iterator/detail/enable_if.hpp> #include <boost/iterator/detail/enable_if.hpp>
#include <boost/implicit_cast.hpp>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
#include <boost/utility/addressof.hpp>
#include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/add_const.hpp> #include <boost/type_traits/add_const.hpp>
@ -105,6 +105,7 @@ namespace boost
typedef typename remove_const<ValueParam>::type value_type; typedef typename remove_const<ValueParam>::type value_type;
// Not the real associated pointer type
typedef typename mpl::eval_if< typedef typename mpl::eval_if<
boost::detail::iterator_writability_disabled<ValueParam,Reference> boost::detail::iterator_writability_disabled<ValueParam,Reference>
, add_pointer<const value_type> , add_pointer<const value_type>
@ -293,46 +294,43 @@ namespace boost
// operator->() needs special support for input iterators to strictly meet the // operator->() needs special support for input iterators to strictly meet the
// standard's requirements. If *i is not a reference type, we must still // standard's requirements. If *i is not a reference type, we must still
// produce a lvalue to which a pointer can be formed. We do that by // produce a lvalue to which a pointer can be formed. We do that by
// returning an instantiation of this special proxy class template. // returning a proxy object containing an instance of the reference object.
template <class T> template <class Reference, class Pointer>
struct operator_arrow_proxy struct operator_arrow_dispatch // proxy references
{ {
operator_arrow_proxy(T const* px) : m_value(*px) {} struct proxy
T* operator->() const { return &m_value; } {
// This function is needed for MWCW and BCC, which won't call operator-> explicit proxy(Reference const & x) : m_ref(x) {}
// again automatically per 13.3.1.2 para 8 Reference* operator->() { return boost::addressof(m_ref); }
operator T*() const { return &m_value; } // This function is needed for MWCW and BCC, which won't call
mutable T m_value; // operator-> again automatically per 13.3.1.2 para 8
operator Reference*() { return boost::addressof(m_ref); }
Reference m_ref;
};
typedef proxy result_type;
static result_type apply(Reference const & x)
{
return result_type(x);
}
}; };
// A metafunction that gets the result type for operator->. Also template <class T, class Pointer>
// has a static function make() which builds the result from a struct operator_arrow_dispatch<T&, Pointer> // "real" references
// Reference
template <class ValueType, class Reference, class Pointer>
struct operator_arrow_result
{ {
// CWPro8.3 won't accept "operator_arrow_result::type", and we typedef Pointer result_type;
// need that type below, so metafunction forwarding would be a static result_type apply(T& x)
// losing proposition here.
typedef typename mpl::if_<
is_reference<Reference>
, Pointer
, operator_arrow_proxy<ValueType>
>::type type;
static type make(Reference x)
{ {
return implicit_cast<type>(&x); return boost::addressof(x);
} }
}; };
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) # if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
// Deal with ETI // Deal with ETI
template<> template<>
struct operator_arrow_result<int, int, int> struct operator_arrow_dispatch<int, int>
{ {
typedef int type; typedef int result_type;
}; };
# endif # endif
@ -617,6 +615,11 @@ namespace boost
Value, CategoryOrTraversal, Reference, Difference Value, CategoryOrTraversal, Reference, Difference
> associated_types; > associated_types;
typedef boost::detail::operator_arrow_dispatch<
Reference
, typename associated_types::pointer
> operator_arrow_dispatch_;
protected: protected:
// For use by derived classes // For use by derived classes
typedef iterator_facade<Derived,Value,CategoryOrTraversal,Reference,Difference> iterator_facade_; typedef iterator_facade<Derived,Value,CategoryOrTraversal,Reference,Difference> iterator_facade_;
@ -626,7 +629,9 @@ namespace boost
typedef typename associated_types::value_type value_type; typedef typename associated_types::value_type value_type;
typedef Reference reference; typedef Reference reference;
typedef Difference difference_type; typedef Difference difference_type;
typedef typename associated_types::pointer pointer;
typedef typename operator_arrow_dispatch_::result_type pointer;
typedef typename associated_types::iterator_category iterator_category; typedef typename associated_types::iterator_category iterator_category;
reference operator*() const reference operator*() const
@ -634,18 +639,9 @@ namespace boost
return iterator_core_access::dereference(this->derived()); return iterator_core_access::dereference(this->derived());
} }
typename boost::detail::operator_arrow_result< pointer operator->() const
value_type
, reference
, pointer
>::type
operator->() const
{ {
return boost::detail::operator_arrow_result< return operator_arrow_dispatch_::apply(*this->derived());
value_type
, reference
, pointer
>::make(*this->derived());
} }
typename boost::detail::operator_brackets_result<Derived,Value,reference>::type typename boost::detail::operator_brackets_result<Derived,Value,reference>::type

View File

@ -7,7 +7,6 @@
#ifndef BOOST_TRANSFORM_ITERATOR_23022003THW_HPP #ifndef BOOST_TRANSFORM_ITERATOR_23022003THW_HPP
#define BOOST_TRANSFORM_ITERATOR_23022003THW_HPP #define BOOST_TRANSFORM_ITERATOR_23022003THW_HPP
#include <boost/function.hpp>
#include <boost/iterator.hpp> #include <boost/iterator.hpp>
#include <boost/iterator/detail/enable_if.hpp> #include <boost/iterator/detail/enable_if.hpp>
#include <boost/iterator/iterator_adaptor.hpp> #include <boost/iterator/iterator_adaptor.hpp>
@ -21,6 +20,8 @@
#include <boost/type_traits/is_reference.hpp> #include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/remove_const.hpp> #include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp> #include <boost/type_traits/remove_reference.hpp>
#include <boost/utility/result_of.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310)) #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310))
# include <boost/type_traits/is_base_and_derived.hpp> # include <boost/type_traits/is_base_and_derived.hpp>
@ -36,33 +37,16 @@ namespace boost
namespace detail namespace detail
{ {
template <class UnaryFunc>
struct function_object_result
{
typedef typename UnaryFunc::result_type type;
};
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class Return, class Argument>
struct function_object_result<Return(*)(Argument)>
{
typedef Return type;
};
#endif
// Compute the iterator_adaptor instantiation to be used for transform_iterator // Compute the iterator_adaptor instantiation to be used for transform_iterator
template <class UnaryFunc, class Iterator, class Reference, class Value> template <class UnaryFunc, class Iterator, class Reference, class Value>
struct transform_iterator_base struct transform_iterator_base
{ {
private: private:
// By default, dereferencing the iterator yields the same as // By default, dereferencing the iterator yields the same as
// the function. Do we need to adjust the way // the function.
// function_object_result is computed for the standard
// proposal (e.g. using Doug's result_of)?
typedef typename ia_dflt_help< typedef typename ia_dflt_help<
Reference Reference
, function_object_result<UnaryFunc> , result_of<const UnaryFunc(typename std::iterator_traits<Iterator>::reference)>
>::type reference; >::type reference;
// To get the default for Value: remove any reference on the // To get the default for Value: remove any reference on the
@ -114,7 +98,7 @@ namespace boost
#endif #endif
} }
template< template <
class OtherUnaryFunction class OtherUnaryFunction
, class OtherIterator , class OtherIterator
, class OtherReference , class OtherReference

View File

@ -357,7 +357,7 @@ namespace boost {
{ {
typedef typename tuple_impl_specific::tuple_meta_transform< typedef typename tuple_impl_specific::tuple_meta_transform<
IteratorTuple IteratorTuple
, iterator_traversal<> , pure_traversal_tag<iterator_traversal<> >
>::type tuple_of_traversal_tags; >::type tuple_of_traversal_tags;
typedef typename tuple_impl_specific::tuple_meta_accumulate< typedef typename tuple_impl_specific::tuple_meta_accumulate<

View File

@ -11,7 +11,7 @@
// //
// Defines enum boost::memory_order per the C++0x working draft // Defines enum boost::memory_order per the C++0x working draft
// //
// Copyright (c) 2008 Peter Dimov // Copyright (c) 2008, 2009 Peter Dimov
// //
// 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
@ -21,13 +21,31 @@
namespace boost namespace boost
{ {
//
// Enum values are chosen so that code that needs to insert
// a trailing fence for acquire semantics can use a single
// test such as:
//
// if( mo & memory_order_acquire ) { ...fence... }
//
// For leading fences one can use:
//
// if( mo & memory_order_release ) { ...fence... }
//
// Architectures such as Alpha that need a fence on consume
// can use:
//
// if( mo & ( memory_order_acquire | memory_order_consume ) ) { ...fence... }
//
enum memory_order enum memory_order
{ {
memory_order_relaxed = 0, memory_order_relaxed = 0,
memory_order_acquire = 1, memory_order_acquire = 1,
memory_order_release = 2, memory_order_release = 2,
memory_order_acq_rel = 3, // acquire | release memory_order_acq_rel = 3, // acquire | release
memory_order_seq_cst = 7 // acq_rel | 4 memory_order_seq_cst = 7, // acq_rel | 4
memory_order_consume = 8
}; };
} // namespace boost } // namespace boost

View File

@ -10,9 +10,9 @@
// //
// See http://www.boost.org/libs/mpl for documentation. // See http://www.boost.org/libs/mpl for documentation.
// $Id: O1_size.hpp,v 1.1 2009/08/23 12:38:10 pschaefer Exp $ // $Id: O1_size.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2009/08/23 12:38:10 $ // $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 1.1 $ // $Revision: 49267 $
#include <boost/mpl/O1_size_fwd.hpp> #include <boost/mpl/O1_size_fwd.hpp>
#include <boost/mpl/sequence_tag.hpp> #include <boost/mpl/sequence_tag.hpp>

View File

@ -10,9 +10,9 @@
// //
// See http://www.boost.org/libs/mpl for documentation. // See http://www.boost.org/libs/mpl for documentation.
// $Id: O1_size_fwd.hpp,v 1.1 2009/08/23 12:38:09 pschaefer Exp $ // $Id: O1_size_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2009/08/23 12:38:09 $ // $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 1.1 $ // $Revision: 49267 $
namespace boost { namespace mpl { namespace boost { namespace mpl {

View File

@ -11,9 +11,9 @@
// //
// See http://www.boost.org/libs/mpl for documentation. // See http://www.boost.org/libs/mpl for documentation.
// $Id: accumulate.hpp,v 1.1 2009/08/23 12:38:09 pschaefer Exp $ // $Id: accumulate.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2009/08/23 12:38:09 $ // $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 1.1 $ // $Revision: 49267 $
#include <boost/mpl/fold.hpp> #include <boost/mpl/fold.hpp>
#include <boost/mpl/aux_/na_spec.hpp> #include <boost/mpl/aux_/na_spec.hpp>

View File

@ -10,9 +10,9 @@
// //
// See http://www.boost.org/libs/mpl for documentation. // See http://www.boost.org/libs/mpl for documentation.
// $Id: advance.hpp,v 1.1 2009/08/23 12:38:10 pschaefer Exp $ // $Id: advance.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2009/08/23 12:38:10 $ // $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 1.1 $ // $Revision: 49267 $
#include <boost/mpl/advance_fwd.hpp> #include <boost/mpl/advance_fwd.hpp>
#include <boost/mpl/less.hpp> #include <boost/mpl/less.hpp>

View File

@ -10,9 +10,9 @@
// //
// See http://www.boost.org/libs/mpl for documentation. // See http://www.boost.org/libs/mpl for documentation.
// $Id: advance_fwd.hpp,v 1.1 2009/08/23 12:38:09 pschaefer Exp $ // $Id: advance_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2009/08/23 12:38:09 $ // $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 1.1 $ // $Revision: 49267 $
#include <boost/mpl/aux_/common_name_wknd.hpp> #include <boost/mpl/aux_/common_name_wknd.hpp>

View File

@ -10,9 +10,9 @@
// //
// See http://www.boost.org/libs/mpl for documentation. // See http://www.boost.org/libs/mpl for documentation.
// $Id: alias.hpp,v 1.1 2009/08/23 12:38:09 pschaefer Exp $ // $Id: alias.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2009/08/23 12:38:09 $ // $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 1.1 $ // $Revision: 49267 $
namespace { namespace {
namespace mpl = boost::mpl; namespace mpl = boost::mpl;

Some files were not shown because too many files have changed in this diff Show More