typeinfo.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (c) 1999
  3. * Boris Fomitchev
  4. *
  5. * This material is provided "as is", with absolutely no warranty expressed
  6. * or implied. Any use is at your own risk.
  7. *
  8. * Permission to use or copy this software for any purpose is hereby granted
  9. * without fee, provided the above notices are retained on all copies.
  10. * Permission to modify the code and to distribute modified code is granted,
  11. * provided the above notices are retained, and a notice that the code was
  12. * modified is included with the above copyright notice.
  13. *
  14. */
  15. // DMC has hardcoded inclusion of typeinfo.h at the begining of any translation unit.
  16. // So inclusion of this header will directly reference the native header. This is not
  17. // a problem as typeinfo.h is neither a C nor C++ Standard header, this header should
  18. // never be used in user code.
  19. #if defined (__DMC__)
  20. // We define _STLP_OUTERMOST_HEADER_ID to signal to other STLport headers that inclusion
  21. // is done from native typeinfo.h (see exception header).
  22. # define _STLP_OUTERMOST_HEADER_ID 0x874
  23. # include <../include/typeinfo.h>
  24. # undef _STLP_OUTERMOST_HEADER_ID
  25. #else
  26. # ifndef _STLP_OLDSTD_typeinfo
  27. # define _STLP_OLDSTD_typeinfo
  28. # ifndef _STLP_OUTERMOST_HEADER_ID
  29. # define _STLP_OUTERMOST_HEADER_ID 0x874
  30. # include <stl/_prolog.h>
  31. # endif
  32. # ifndef _STLP_NO_TYPEINFO
  33. # if defined (__GNUC__)
  34. # undef _STLP_OLDSTD_typeinfo
  35. # include <typeinfo>
  36. # define _STLP_OLDSTD_typeinfo
  37. # else
  38. # if defined (_STLP_HAS_INCLUDE_NEXT)
  39. # include_next <typeinfo.h>
  40. # elif !defined (__BORLANDC__) || (__BORLANDC__ < 0x580)
  41. # include _STLP_NATIVE_CPP_RUNTIME_HEADER(typeinfo.h)
  42. # else
  43. # include _STLP_NATIVE_CPP_C_HEADER(typeinfo.h)
  44. # endif
  45. # if defined (__BORLANDC__) && (__BORLANDC__ >= 0x580) || \
  46. defined (__DMC__)
  47. using std::type_info;
  48. using std::bad_typeid;
  49. using std::bad_cast;
  50. # endif
  51. # endif
  52. // if <typeinfo> already included, do not import anything
  53. # if defined (_STLP_USE_OWN_NAMESPACE) && !(defined (_STLP_TYPEINFO) && !defined (_STLP_NO_NEW_NEW_HEADER))
  54. _STLP_BEGIN_NAMESPACE
  55. using _STLP_VENDOR_EXCEPT_STD :: type_info;
  56. # if !(defined(__MRC__) || (defined(__SC__) && !defined(__DMC__)))
  57. using _STLP_VENDOR_EXCEPT_STD :: bad_typeid;
  58. # endif
  59. using _STLP_VENDOR_EXCEPT_STD :: bad_cast;
  60. _STLP_END_NAMESPACE
  61. # endif /* _STLP_OWN_NAMESPACE */
  62. # endif /* _STLP_NO_TYPEINFO */
  63. # if (_STLP_OUTERMOST_HEADER_ID == 0x874)
  64. # include <stl/_epilog.h>
  65. # undef _STLP_OUTERMOST_HEADER_ID
  66. # endif
  67. # endif /* _STLP_OLDSTD_typeinfo */
  68. #endif /* __DMC__ */
  69. // Local Variables:
  70. // mode:C++
  71. // End: