ICU-8343 fix build errors in Visual Studio when exception is disabled

X-SVN-Rev: 32010
This commit is contained in:
Jungshik Shin 2012-06-28 23:28:00 +00:00
parent 0a783f3908
commit 4934b397a8
33 changed files with 80 additions and 52 deletions

1
.gitattributes vendored
View 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

View file

@ -10,7 +10,7 @@
// class RuleBasedBreakIterator
//
#include <typeinfo> // for 'typeid' to work
#include "utypeinfo.h" // for 'typeid' to work
#include "unicode/utypes.h"

View 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"

View 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"

View 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"

View 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"

View file

@ -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

View file

@ -24,7 +24,7 @@
*******************************************************************************
*/
#include <typeinfo> // for 'typeid' to work
#include "utypeinfo.h" // for 'typeid' to work
#include "unicode/utypes.h"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View file

@ -9,7 +9,7 @@
**********************************************************************
*/
#include <typeinfo> // for 'typeid' to work
#include "utypeinfo.h" // for 'typeid' to work
#include "olsontz.h"

View file

@ -5,7 +5,7 @@
*******************************************************************************
*/
#include <typeinfo> // for 'typeid' to work
#include "utypeinfo.h" // for 'typeid' to work
#include "unicode/rbnf.h"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View file

@ -5,7 +5,7 @@
*******************************************************************************
*/
#include <typeinfo> // for 'typeid' to work
#include "utypeinfo.h" // for 'typeid' to work
#include "unicode/tmutfmt.h"

View 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"

View 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"

View 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"

View file

@ -5,7 +5,7 @@
*******************************************************************************
*/
#include <typeinfo> // for 'typeid' to work
#include "utypeinfo.h" // for 'typeid' to work
#include "unicode/utypes.h"

View 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"

View 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"

View 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"

View 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"

View 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