+2000-11-19 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (init_decl_processing): Correct name of pure virtual
+ function under the new ABI.
+ * rtti.c (throw_bad_cast): Likewise, for bad cast function.
+ (throw_bad_typeid): Likewise for bad typeid function.
+
2000-11-18 Mark Mitchell <mark@codesourcery.com>
* decl.c (grokparms): Don't even function types of `void' type,
}
abort_fndecl
- = build_library_fn_ptr ("__pure_virtual", void_ftype);
+ = build_library_fn_ptr ((flag_new_abi
+ ? "__cxa_pure_virtual"
+ : "__pure_virtual"),
+ void_ftype);
/* Perform other language dependent initializations. */
init_class_processing ();
static tree
throw_bad_cast ()
{
- tree fn = get_identifier ("__throw_bad_cast");
+ tree fn = get_identifier (flag_new_abi
+ ? "__cxa_bad_cast" :
+ "__throw_bad_cast");
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
static tree
throw_bad_typeid ()
{
- tree fn = get_identifier ("__throw_bad_typeid");
+ tree fn = get_identifier (flag_new_abi
+ ? "__cxa_bad_typeid"
+ : "__throw_bad_typeid");
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
+2000-11-19 Mark Mitchell <mark@codesourcery.com>
+
+ * libsupc++/exception_support.cc (__throw_bad_cast): Name it
+ __cxa_bad_cast under the new ABI.
+ (__throw_bad_typeid): Name it __cxa_bad_typeid under the new ABI.
+ * libsupc++/pure.cc (__pure_virtual): Name it __cxa_pure_virtual
+ under the new ABI.
+
2000-11-18 Mark Mitchell <mark@codesourcery.com>
* libsupc++/exception_support.h: New header file.
// Helpers for rtti. Although these don't return, we give them return types so
// that the type system is not broken.
+#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
+#define THROW_BAD_CAST __throw_bad_cast
+#define THROW_BAD_TYPEID __throw_bad_typeid
+#else
+#define THROW_BAD_CAST __cxa_bad_cast
+#define THROW_BAD_TYPEID __cxa_bad_typeid
+#endif
+
extern "C" void *
-__throw_bad_cast ()
+THROW_BAD_CAST ()
{
throw std::bad_cast ();
return 0;
}
extern "C" std::type_info const &
-__throw_bad_typeid ()
+THROW_BAD_TYPEID ()
{
throw std::bad_typeid ();
return typeid (void);
extern void __terminate(void) __attribute__ ((__noreturn__));
+// The name of the function to be placed in vtables in place of a pure
+// virtual function is different in the two ABIs.
+#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
+#define PURE_VIRTUAL_NAME __pure_virtual
+#else
+#define PURE_VIRTUAL_NAME __cxa_pure_virtual
+#endif
+
void
-__pure_virtual (void)
+PURE_VIRTUAL_NAME (void)
{
writestr ("pure virtual method called\n");
__terminate ();