add a check for support of C++11 inline namespace

This commit is contained in:
Jinhao 2016-02-17 00:32:15 +08:00
parent 41830d46ba
commit 5e09cf1aef
3 changed files with 16 additions and 3 deletions

View File

@ -39,13 +39,15 @@
#ifndef NANA_CXX_DEFINES_INCLUDED
#define NANA_CXX_DEFINES_INCLUDED
#define STD_FILESYSTEM_NOT_SUPPORTED
//C++ language
#if defined(_MSC_VER)
# undef STD_FILESYSTEM_NOT_SUPPORTED
# if (_MSC_VER < 1900)
# //Nana defines some macros for lack of support of keywords
# define _ALLOW_KEYWORD_MACROS
#
#
# define CXX_NO_INLINE_NAMESPACE //no support of C++11 inline namespace until Visual C++ 2015
# define noexcept //no support of noexcept until Visual C++ 2015
# define constexpr //no support of constexpr until Visual C++ 2015
# endif

View File

@ -42,8 +42,13 @@
// namespace std { namespace experimental { namespace filesystem { inline namespace v1 {
namespace nana { namespace experimental { inline namespace v1
namespace nana { namespace experimental {
#ifndef CXX_NO_INLINE_NAMESPACE
inline namespace v1
{
#endif
namespace filesystem
{
enum class file_type
@ -367,8 +372,9 @@ namespace filesystem
return index ? path.substr(0, index + 1) : std::basic_string<CharType>();
}
#ifndef CXX_NO_INLINE_NAMESPACE
} //end namespace v1
#endif
} //end namespace filesystem
} //end namespace experimental

View File

@ -38,7 +38,9 @@
namespace nana { namespace experimental {
#ifndef CXX_NO_INLINE_NAMESPACE
inline namespace v1 {
#endif
namespace filesystem
{
//class filesystem_error
@ -870,7 +872,10 @@ namespace nana { namespace experimental {
::chdir(p.c_str());
#endif
}
#ifndef CXX_NO_INLINE_NAMESPACE
} //end namespace v1
#endif
}//end namespace filesystem
} //end namespace experimental
}//end namespace nana