diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-10-15 07:01:17 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-10-15 07:01:17 +0200 |
commit | 4cb3716317207e3a6813b0d9ff779edc7fec91de (patch) | |
tree | f9f5ce8fc96df13a1b87be47124b25f0af7435f9 /libcommon/common | |
parent | ccb45f5515e31f394f5164d8675b43f6b3f8b66c (diff) |
Automatically map C++11 enum classes (strong enums)
Diffstat (limited to 'libcommon/common')
-rw-r--r-- | libcommon/common/config-vc.h | 6 | ||||
-rw-r--r-- | libcommon/common/config.hxx | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index 17d1bd0..fe14255 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -15,6 +15,12 @@ #if (defined(_MSC_VER) && _MSC_VER >= 1600) || \ (defined(ODB_MSC_VER) && ODB_MSC_VER >= 1600) # define HAVE_CXX11 +// Strongly typed enums are supported starting from VC++11. +// +# if (defined(_MSC_VER) && _MSC_VER >= 1700) || \ + (defined(ODB_MSC_VER) && ODB_MSC_VER >= 1700) +# define HAVE_CXX11_ENUM +# endif #endif #endif /* LIBCOMMON_COMMON_CONFIG_VC_H */ diff --git a/libcommon/common/config.hxx b/libcommon/common/config.hxx index da45841..08cf0e5 100644 --- a/libcommon/common/config.hxx +++ b/libcommon/common/config.hxx @@ -9,6 +9,13 @@ # include <common/config-vc.h> #else # include <common/config.h> + +// GCC supports strongly typed enums from 4.4 (forward -- 4.6), +// Clang -- 2.9 (3.1). +// +# ifdef HAVE_CXX11 +# define HAVE_CXX11_ENUM +# endif #endif #endif // LIBCOMMON_COMMON_CONFIG_HXX |