struct cp_eh_info
{
-#ifdef NEW_EH_MODEL
__eh_info eh_info;
-#endif
void *value;
void *type;
void (*cleanup)(void *, int);
extern bool __is_pointer (void *);
+
+/* OLD Compiler hook to return a pointer to the info for the current exception.
+ Used by get_eh_info (). This fudges the actualy returned value to
+ point to the beginning of what USE to be the cp_eh_info structure.
+ THis is so that old code that dereferences this pointer will find
+ things where it expects it to be.*/
+extern "C" void *
+__cp_exception_info (void)
+{
+ return &((*__get_eh_info ())->value);
+}
+
/* Compiler hook to return a pointer to the info for the current exception.
Used by get_eh_info (). */
extern "C" cp_eh_info *
-__cp_exception_info (void)
+__cp_eh_info (void)
{
return *__get_eh_info ();
}
}
-#ifdef NEW_EH_MODEL
-
typedef void * (* rtimetype) (void);
extern "C" void *
ret = __throw_type_match_rtti (match_type, info->type, info->value);
return ret;
}
-#endif
/* Compiler hook to push a new exception onto the stack.
p->handlers = 0;
p->caught = false;
-#ifdef NEW_EH_MODEL
p->eh_info.match_function = __cplus_type_matcher;
p->eh_info.language = EH_LANG_C_plus_plus;
p->eh_info.version = 1;
p->eh_info.coerced_value = NULL;
-#endif
cp_eh_info **q = __get_eh_info ();
extern "C" void
__uncatch_exception (void)
{
- cp_eh_info *p = __cp_exception_info ();
+ cp_eh_info *p = __cp_eh_info ();
if (p == 0)
terminate ();
p->caught = false;
extern "C" void
__check_eh_spec (int n, const void **spec)
{
- cp_eh_info *p = __cp_exception_info ();
+ cp_eh_info *p = __cp_eh_info ();
for (int i = 0; i < n; ++i)
{
bool
std::uncaught_exception ()
{
- cp_eh_info *p = __cp_exception_info ();
+ cp_eh_info *p = __cp_eh_info ();
return p && ! p->caught;
}