diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2014-01-19 10:05:08 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2014-01-19 10:06:32 +0200 |
commit | 0fdf19714613a82a184f4f6e75fb9a4f9b62f18a (patch) | |
tree | 93bb2df0f9d9eab44d36dedf29d4df500ecefcbc /libxsd/xsd/cxx/config.hxx | |
parent | 45db924dfc19b49b7930522dbddd123fb9575e32 (diff) |
Use std::unique_ptr instead of std::auto_ptr in C++11 mode
Diffstat (limited to 'libxsd/xsd/cxx/config.hxx')
-rw-r--r-- | libxsd/xsd/cxx/config.hxx | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/libxsd/xsd/cxx/config.hxx b/libxsd/xsd/cxx/config.hxx index 1c214fc..e4d6a48 100644 --- a/libxsd/xsd/cxx/config.hxx +++ b/libxsd/xsd/cxx/config.hxx @@ -8,7 +8,40 @@ #include <xsd/cxx/version.hxx> -// Macro to suppress unused variable warning. +// Available C++11 features. +// +#ifdef XSD_CXX11 +#ifdef _MSC_VER +# if _MSC_VER >= 1600 +# define XSD_CXX11_NULLPTR +# if _MSC_VER >= 1800 +# define XSD_CXX11_TEMPLATE_ALIAS +# endif +# endif +#else +# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L +# ifdef __GNUC__ +# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4 +# define XSD_CXX11_NULLPTR +# endif +# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || __GNUC__ > 4 +# define XSD_CXX11_TEMPLATE_ALIAS +# endif +# else +# define XSD_CXX11_NULLPTR +# define XSD_CXX11_TEMPLATE_ALIAS +# endif +# endif +#endif +#endif // XSD_CXX11 + +#ifdef XSD_CXX11 +# define XSD_AUTO_PTR std::unique_ptr +#else +# define XSD_AUTO_PTR std::auto_ptr +#endif + +// Macro to suppress the unused variable warning. // #define XSD_UNUSED(x) (void)x |