mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-12406 disable U_NOEXCEPT if !_HAS_EXCEPTIONS
X-SVN-Rev: 38542
This commit is contained in:
parent
d64e688fec
commit
34dc0a8069
2 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue