ICU-12406 disable U_NOEXCEPT if !_HAS_EXCEPTIONS

X-SVN-Rev: 38542
This commit is contained in:
Markus Scherer 2016-03-18 20:55:10 +00:00
parent d64e688fec
commit 34dc0a8069
2 changed files with 6 additions and 4 deletions

View file

@ -520,6 +520,8 @@
*/
#ifdef U_NOEXCEPT
/* Use the predefined value. */
#elif defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS /* Visual Studio */
# define U_NOEXCEPT
#elif U_CPLUSPLUS_VERSION >= 11 || __has_feature(cxx_noexcept) || __has_extension(cxx_noexcept) \
|| (defined(_MSC_VER) && _MSC_VER >= 1900) /* Visual Studio 2015 */
# define U_NOEXCEPT noexcept

View file

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 2012-2014, International Business Machines
* Copyright (C) 2012-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@ -11,12 +11,12 @@
#define __UTYPEINFO_H__
// Windows header <typeinfo> does not define 'exception' in 'std' namespace.
// Therefore, a project using ICU cannot be compiled with _HAS_EXCEPTION
// Therefore, a project using ICU cannot be compiled with _HAS_EXCEPTIONS
// set to 0 on Windows with Visual Studio. To work around that, we have to
// include <exception> explicilty and add using statement below.
// include <exception> explicitly and add using statement below.
// Whenever 'typeid' is used, this header has to be included
// instead of <typeinfo>.
// Visual Stuido 10 emits warning 4275 with this change. If you compile
// Visual Studio 10 emits warning 4275 with this change. If you compile
// with exception disabled, you have to suppress warning 4275.
#if defined(_MSC_VER) && _HAS_EXCEPTIONS == 0
#include <exception>