]> git.saurik.com Git - apple/icu.git/blame - icuSources/common/utypeinfo.h
ICU-57166.0.1.tar.gz
[apple/icu.git] / icuSources / common / utypeinfo.h
CommitLineData
51004dcb
A
1/*
2******************************************************************************
3*
2ca993e8 4* Copyright (C) 2012-2016, International Business Machines
51004dcb
A
5* Corporation and others. All Rights Reserved.
6*
7******************************************************************************
8*/
9
10#ifndef __UTYPEINFO_H__
11#define __UTYPEINFO_H__
12
13// Windows header <typeinfo> does not define 'exception' in 'std' namespace.
2ca993e8 14// Therefore, a project using ICU cannot be compiled with _HAS_EXCEPTIONS
51004dcb 15// set to 0 on Windows with Visual Studio. To work around that, we have to
2ca993e8 16// include <exception> explicitly and add using statement below.
51004dcb
A
17// Whenever 'typeid' is used, this header has to be included
18// instead of <typeinfo>.
2ca993e8 19// Visual Studio 10 emits warning 4275 with this change. If you compile
51004dcb
A
20// with exception disabled, you have to suppress warning 4275.
21#if defined(_MSC_VER) && _HAS_EXCEPTIONS == 0
22#include <exception>
23using std::exception;
24#endif
57a6839d
A
25#if !defined(_MSC_VER)
26namespace std { class type_info; } // WORKAROUND: http://llvm.org/bugs/show_bug.cgi?id=13364
27#endif
51004dcb
A
28#include <typeinfo> // for 'typeid' to work
29
30#endif