summaryrefslogtreecommitdiff
path: root/libxsd/xsd/cxx/config.hxx
blob: 1cd3101051eb27078cfd16782a4dd4a02fabe0d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// file      : xsd/cxx/config.hxx
// license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

#ifndef XSD_CXX_CONFIG_HXX
#define XSD_CXX_CONFIG_HXX

#include <xsd/cxx/version.hxx>

// 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

#endif // XSD_CXX_CONFIG_HXX