]> granicus.if.org Git - icu/commitdiff
ICU-8343 fix build errors in Visual Studio when exception is disabled
authorJungshik Shin <jshin@chromium.org>
Thu, 28 Jun 2012 23:28:00 +0000 (23:28 +0000)
committerJungshik Shin <jshin@chromium.org>
Thu, 28 Jun 2012 23:28:00 +0000 (23:28 +0000)
X-SVN-Rev: 32010

33 files changed:
.gitattributes
icu4c/source/common/rbbi.cpp
icu4c/source/common/schriter.cpp
icu4c/source/common/stringtriebuilder.cpp
icu4c/source/common/uchriter.cpp
icu4c/source/common/ustrenum.cpp
icu4c/source/common/utypeinfo.h [new file with mode: 0644]
icu4c/source/i18n/calendar.cpp
icu4c/source/i18n/currfmt.cpp
icu4c/source/i18n/currunit.cpp
icu4c/source/i18n/dtitvfmt.cpp
icu4c/source/i18n/dtrule.cpp
icu4c/source/i18n/format.cpp
icu4c/source/i18n/measure.cpp
icu4c/source/i18n/nfsubs.cpp
icu4c/source/i18n/olsontz.cpp
icu4c/source/i18n/rbnf.cpp
icu4c/source/i18n/rbtz.cpp
icu4c/source/i18n/selfmt.cpp
icu4c/source/i18n/simpletz.cpp
icu4c/source/i18n/tblcoll.cpp
icu4c/source/i18n/timezone.cpp
icu4c/source/i18n/tmunit.cpp
icu4c/source/i18n/tmutfmt.cpp
icu4c/source/i18n/translit.cpp
icu4c/source/i18n/tzrule.cpp
icu4c/source/i18n/tztrans.cpp
icu4c/source/i18n/ucal.cpp
icu4c/source/i18n/vtzone.cpp
icu4c/source/test/intltest/citrtest.cpp
icu4c/source/test/intltest/icusvtst.cpp
icu4c/source/test/intltest/rbbitst.cpp
icu4c/source/test/intltest/uobjtest.cpp

index 4b9402d9774880c577ffb9ba3d0de489f824f065..6a9523dec9f51fee0cda925f4105f421b1a3caba 100644 (file)
@@ -52,6 +52,7 @@ icu4c/icu4c.css -text
 icu4c/source/allinone/icucheck.bat -text
 icu4c/source/common/common.vcxproj -text
 icu4c/source/common/common.vcxproj.filters -text
+icu4c/source/common/utypeinfo.h -text
 icu4c/source/data/curr/pool.res -text
 icu4c/source/data/in/coll/invuca.icu -text
 icu4c/source/data/in/coll/ucadata.icu -text
index f76d02ae294c2aaf3593639661b2196e5b9fb1df..b251a1dd7e3339f384cb195f0ba1341a75065221 100644 (file)
@@ -10,7 +10,7 @@
 //                   class RuleBasedBreakIterator
 //
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index b2263390c690a07a5b270a878d182a6cf4e1bef3..17ce400186969adbd2d088470299019446941df7 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ******************************************************************************
-* Copyright (C) 1998-2010, International Business Machines Corporation and
+* Copyright (C) 1998-2012, International Business Machines Corporation and
 * others. All Rights Reserved.
 ******************************************************************************
 *
@@ -13,7 +13,7 @@
 ******************************************************************************
 */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/chariter.h"
 #include "unicode/schriter.h"
index e3e58eb6c4f7d79b0e05d08ab1d4c33d3ac4c859..32a931130cee0fed1ac0d4e9473a182897ff954c 100644 (file)
@@ -1,6 +1,6 @@
 /*
 *******************************************************************************
-*   Copyright (C) 2010-2011, International Business Machines
+*   Copyright (C) 2010-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *******************************************************************************
 *   file name:  stringtriebuilder.cpp
@@ -12,7 +12,7 @@
 *   created by: Markus W. Scherer
 */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 #include "unicode/utypes.h"
 #include "unicode/stringtriebuilder.h"
 #include "uassert.h"
index 2d59e167a1df3d69f27e43961d3c64b063cf0326..40b06ce5acf48672cd1f83a554dbd59cc4a62162 100644 (file)
@@ -1,11 +1,11 @@
 /*
 ******************************************************************************
-* Copyright (C) 1998-2011, International Business Machines Corporation and
+* Copyright (C) 1998-2012, International Business Machines Corporation and
 * others. All Rights Reserved.
 ******************************************************************************
 */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/uchriter.h"
 #include "unicode/ustring.h"
index 4f0b721b82139c34978b8f8009e1130d475efcc0..3956615db315c55905a3493ab7991f51aa2082ae 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-* Copyright (c) 2002-2011, International Business Machines
+* Copyright (c) 2002-2012, International Business Machines
 * Corporation and others.  All Rights Reserved.
 **********************************************************************
 * Author: Alan Liu
@@ -8,7 +8,7 @@
 * Since: ICU 2.4
 **********************************************************************
 */
-#include <typeinfo>  // for 'typeid' to work 
+#include "utypeinfo.h"  // for 'typeid' to work 
 
 #include "unicode/ustring.h"
 #include "unicode/strenum.h"
diff --git a/icu4c/source/common/utypeinfo.h b/icu4c/source/common/utypeinfo.h
new file mode 100644 (file)
index 0000000..4de16d6
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+******************************************************************************
+*
+*   Copyright (C) 2012, International Business Machines
+*   Corporation and others.  All Rights Reserved.
+*
+******************************************************************************
+*/
+
+#ifndef __UTYPEINFO_H__
+#define __UTYPEINFO_H__
+
+// Windows header <typeinfo> does not define 'exception' in 'std' namespace.
+// Therefore, a project using ICU cannot be compiled with _HAS_EXCEPTION
+// set to 0 on Windows with Visual Studio. To work around that, we have to
+// include <exception> explicilty 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
+// with exception disabled, you have to suppress warning 4275.
+#if defined(_MSC_VER) && _HAS_EXCEPTIONS == 0
+#include <exception>
+using std::exception;
+#endif
+#include <typeinfo>  // for 'typeid' to work
+
+#endif
index 41671de56589e970531cb573010b99b2ba3d2266..2e5560f2a510d985c142acca05ee8b26a8373f7f 100644 (file)
@@ -24,7 +24,7 @@
 *******************************************************************************
 */
 
-#include <typeinfo>  // for 'typeid' to work 
+#include "utypeinfo.h"  // for 'typeid' to work 
 
 #include "unicode/utypes.h"
 
index d3de2ab633d64fc39331bcb696407df03559e68a..97be9730f35595d01231970e98ac2cb855963730 100644 (file)
@@ -8,7 +8,7 @@
 * Since: ICU 3.0
 **********************************************************************
 */
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index 47cba6253aaff94e6f30ef4e546553c2a86b50a4..870d9d0c4ce8bb6f60500e9ac7ce9960ebd3f036 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-* Copyright (c) 2004-2010, International Business Machines
+* Copyright (c) 2004-2012, International Business Machines
 * Corporation and others.  All Rights Reserved.
 **********************************************************************
 * Author: Alan Liu
@@ -8,7 +8,7 @@
 * Since: ICU 3.0
 **********************************************************************
 */
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index 79f67ab605819e082ca9e9f05aca0558717cd07a..fbf8787c1ec63782f2ff0753a009c88af5f4b88f 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
-* Copyright (C) 2008-2011, International Business Machines Corporation and
+* Copyright (C) 2008-2012, International Business Machines Corporation and
 * others. All Rights Reserved.
 *******************************************************************************
 *
@@ -8,7 +8,7 @@
 *******************************************************************************
 */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/dtitvfmt.h"
 
index c2eeb052a40ce9b882380d069e9dbb7a44859ef6..b8fd30ea9734303d90201d9c019c7f047ac0a4cf 100644 (file)
@@ -1,11 +1,11 @@
 /*
 *******************************************************************************
-* Copyright (C) 2007-2010, International Business Machines Corporation and
+* Copyright (C) 2007-2012, International Business Machines Corporation and
 * others. All Rights Reserved.
 *******************************************************************************
 */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index d80a44da7a806dcd4c22a069ff6dc3ede8bd3fff..e369e4021a77931f2ef00ffa5a6037ebfb6d181c 100644 (file)
@@ -1,6 +1,6 @@
 /*
 *******************************************************************************
-* Copyright (C) 1997-2011, International Business Machines Corporation and    *
+* Copyright (C) 1997-2012, International Business Machines Corporation and    *
 * others. All Rights Reserved.                                                *
 *******************************************************************************
 *
@@ -19,7 +19,7 @@
 // This file was generated from the java source file Format.java
 // *****************************************************************************
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index 7b91677a3c085d1980820bc2adc823b6ba276332..639de3e6db17ac4aef8eb1e50d2fcb1c7d8dab92 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-* Copyright (c) 2004-2010, International Business Machines
+* Copyright (c) 2004-2012, International Business Machines
 * Corporation and others.  All Rights Reserved.
 **********************************************************************
 * Author: Alan Liu
@@ -8,7 +8,7 @@
 * Since: ICU 3.0
 **********************************************************************
 */
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index 76274af458da963847b5c8ce370ea93c0d805872..35c9ce1a3c8f35c54d22ad247a1521df65cfed00 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ******************************************************************************
-*   Copyright (C) 1997-2011, International Business Machines
+*   Copyright (C) 1997-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 ******************************************************************************
 *   file name:  nfsubs.cpp
@@ -14,7 +14,7 @@
 */
 
 #include <stdio.h>
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "nfsubs.h"
 #include "digitlst.h"
index 7ef662d33fcbe63a945f18bd4d1edb3c26163dd6..992cfe37daaf6562c2a95aea9ff27466f4689f5a 100644 (file)
@@ -9,7 +9,7 @@
 **********************************************************************
 */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "olsontz.h"
 
index bfd4f4a1bd5895c1dc976c0467ebe2d4930728b2..43be8581cd7c47acb19465c764f4bbbf02f96f03 100644 (file)
@@ -5,7 +5,7 @@
 *******************************************************************************
 */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/rbnf.h"
 
index c53ccd7dba1a20da20e173e5be275093d369e9f7..a9d8db5ec4e1cef615a02f7b208d49cb089b31b8 100644 (file)
@@ -1,11 +1,11 @@
 /*
 *******************************************************************************
-* Copyright (C) 2007-2011, International Business Machines Corporation and
+* Copyright (C) 2007-2012, International Business Machines Corporation and
 * others. All Rights Reserved.
 *******************************************************************************
 */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index 0945f036c77e57270939f8eb36e15c26e948f08c..5016e8e30a16c3d83884a56049d900af2e44ed31 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT:
- * Copyright (c) 1997-2011, International Business Machines Corporation and
+ * Copyright (c) 1997-2012, International Business Machines Corporation and
  * others. All Rights Reserved.
  * Copyright (C) 2010 , Yahoo! Inc.
  ********************************************************************
@@ -14,7 +14,7 @@
  *   11/16/09    kirtig      Improved version
  ********************************************************************/
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/messagepattern.h"
 #include "unicode/rbnf.h"
index f04f85f0dbbf9c8d15d6b32ed0dc87c753effb49..2f3b9cc61e9b44c140ee46cac4dfd3ed04331064 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *******************************************************************************
- * Copyright (C) 1997-2011, International Business Machines Corporation and
+ * Copyright (C) 1997-2012, International Business Machines Corporation and
  * others. All Rights Reserved.
  *******************************************************************************
  *
@@ -21,7 +21,7 @@
  ********************************************************************************
  */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index c99c5d480e50cc762823bbed6fc7dbf442ffc52c..83df78271d0b9d23c7f18bbf0b51584e55775c4c 100644 (file)
@@ -54,7 +54,7 @@
  * 01/29/01     synwee      Modified into a C++ wrapper calling C APIs (ucol.h)
  */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index 429068e54b746e34cb178e5a8af3ae4c96a6113a..7c85b8ed9dbbf3adcebd9113677a84e4b86c400c 100644 (file)
@@ -35,7 +35,7 @@
 *                           available IDs code.  Misc. cleanup.
 *********************************************************************************/
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 #include "unicode/ustring.h"
index fb31e252091e10c254942aa9dfb6c295a521fdcf..121b81ce78c6056c621f92a9ab74729bc5e79e00 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *******************************************************************************
- * Copyright (C) 2008-2010, Google, International Business Machines Corporation and
+ * Copyright (C) 2008-2012, Google, International Business Machines Corporation and
  * others. All Rights Reserved.
  *******************************************************************************
  */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/tmunit.h"
 
index e2c3f6a30d8ec668b4882b8f0e1dbd43f8881079..347a6a9d65e5bab6232c26c2272084ea1d824dc1 100644 (file)
@@ -5,7 +5,7 @@
  *******************************************************************************
  */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/tmutfmt.h"
 
index 94e58c39f32aadf78c0d8d5b77647caab35bb57d..e82cd59b0ab3b3ca99ccb45479668f9df365e5fd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  **********************************************************************
- *   Copyright (C) 1999-2011, International Business Machines
+ *   Copyright (C) 1999-2012, International Business Machines
  *   Corporation and others.  All Rights Reserved.
  **********************************************************************
  *   Date        Name        Description
@@ -8,7 +8,7 @@
  **********************************************************************
  */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index e54b9b875fc0a520bc0bbf1a6811e6b76c84cc03..c3e9b4e03549624ed281740c256cc24ca7a54430 100644 (file)
@@ -1,11 +1,11 @@
 /*
 *******************************************************************************
-* Copyright (C) 2007-2010, International Business Machines Corporation and
+* Copyright (C) 2007-2012, International Business Machines Corporation and
 * others. All Rights Reserved.
 *******************************************************************************
 */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index f795e4092888a91287139c2f8041fd8702f8d979..6e0ddf6d39b8aa8ea17f70fff3e915f28a80b60b 100644 (file)
@@ -1,11 +1,11 @@
 /*
 *******************************************************************************
-* Copyright (C) 2007-2010, International Business Machines Corporation and
+* Copyright (C) 2007-2012, International Business Machines Corporation and
 * others. All Rights Reserved.
 *******************************************************************************
 */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index 2a8db94b99a5cc3ace8a157a695e94d0c04c9b8f..ddbbc9a8c1d713e29d8c03d1f844054a8947159b 100644 (file)
@@ -5,7 +5,7 @@
 *******************************************************************************
 */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index 8e8689ffbaeb5d22963e44c02b73aadd12dedc55..b000b22e03f50af4efc55851bac2b436bacf81c3 100644 (file)
@@ -1,11 +1,11 @@
 /*
 *******************************************************************************
-* Copyright (C) 2007-2011, International Business Machines Corporation and
+* Copyright (C) 2007-2012, International Business Machines Corporation and
 * others. All Rights Reserved.
 *******************************************************************************
 */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index be8803d626856486eed6fa13b15dad6418234276..bc9d7439238dc3e4c818d339e186a5ecf5956d2a 100644 (file)
@@ -1,6 +1,6 @@
 /****************************************************************************************
  * COPYRIGHT: 
- * Copyright (c) 1997-2011, International Business Machines Corporation and
+ * Copyright (c) 1997-2012, International Business Machines Corporation and
  * others. All Rights Reserved.
  * Modification History:
  *
@@ -9,7 +9,7 @@
  ****************************************************************************************/
 
 #include <string.h>
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/chariter.h"
 #include "unicode/ustring.h"
index c45c68c9dbfc6c5bc9278552f3479e867f25d277..8de38703cf7aba86ccc5d917462871d5fe22313d 100644 (file)
@@ -1,11 +1,11 @@
 /**
  *******************************************************************************
- * Copyright (C) 2001-2011, International Business Machines Corporation and
+ * Copyright (C) 2001-2012, International Business Machines Corporation and
  * others. All Rights Reserved.
  *******************************************************************************
  */
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index 609241f52f288f40c2ee5d7d487b640a6b4387b8..d09004b32e7892bb3a849fdb356ef987185abe68 100644 (file)
@@ -9,7 +9,7 @@
 *   01/12/2000  Madhu        Updated for changed API and added new tests
 ************************************************************************/
 
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "unicode/utypes.h"
 
index 4639966d9036ca335b1f733bf1fa91c0709020ec..11f1293c5b10b8c7503fdc617e239554c2563d7b 100644 (file)
@@ -1,13 +1,13 @@
 /********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 1997-2011, International Business Machines Corporation and
+ * Copyright (c) 1997-2012, International Business Machines Corporation and
  * others. All Rights Reserved.
  * Copyright (C) 2010 , Yahoo! Inc. 
  ********************************************************************/
 
 #include <stdio.h>
 #include <string.h>
-#include <typeinfo>  // for 'typeid' to work
+#include "utypeinfo.h"  // for 'typeid' to work
 
 #include "uobjtest.h"
 #include "cmemory.h" // UAlignedMemory