From 34dc0a8069a5a1ed923ff19d7d77414faffe12d4 Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Fri, 18 Mar 2016 20:55:10 +0000 Subject: [PATCH] ICU-12406 disable U_NOEXCEPT if !_HAS_EXCEPTIONS X-SVN-Rev: 38542 --- icu4c/source/common/unicode/platform.h | 2 ++ icu4c/source/common/utypeinfo.h | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/icu4c/source/common/unicode/platform.h b/icu4c/source/common/unicode/platform.h index 6a88a6b82fb..1320bd35967 100644 --- a/icu4c/source/common/unicode/platform.h +++ b/icu4c/source/common/unicode/platform.h @@ -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 diff --git a/icu4c/source/common/utypeinfo.h b/icu4c/source/common/utypeinfo.h index 6874c6bcfd7..51c3a03bf7c 100644 --- a/icu4c/source/common/utypeinfo.h +++ b/icu4c/source/common/utypeinfo.h @@ -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 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 explicilty and add using statement below. +// include explicitly and add using statement below. // Whenever 'typeid' is used, this header has to be included // instead of . -// 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 -- 2.40.0