+2002-06-25 Jessica Han <jessica@cup.hp.com>
+
+ * config/os/hpux/os_defines.h Define _GLIBCPP_VTABLE_PADDING
+ * libsupc++/tinfo.cc Handle the 8 byte aligned vtable entries when
+ _GLIBCPP_VTABLE_PADDING is defined.
+
2002-06-25 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/stl_alloc.h: Additional formatting.
-// Specific definitions for generic platforms -*- C++ -*-
+// Specific definitions for HPUX -*- C++ -*-
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// the GNU General Public License.
#ifndef _GLIBCPP_OS_DEFINES
-#define _GLIBCPP_OS_DEFINES
+#define _GLIBCPP_OS_DEFINES 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
We also force _GLIBCPP_USE_LONG_LONG here so that we don't have
to bastardize configure to deal with this sillyness. */
-namespace std {
+namespace std
+{
#ifndef __LP64__
__extension__ extern "C" long long strtoll (const char *, char **, int)
__asm ("__strtoll");
__asm ("strtoul");
#endif
}
+
#define _GLIBCPP_USE_LONG_LONG 1
+
+// HPUX on IA64 requires vtable to be 64 bit aligned even at 32 bit
+// mode. We need to pad the vtable structure to achieve this.
+#if !defined(_LP64) && defined (__ia64__)
+#define _GLIBCPP_VTABLE_PADDING 8
+typedef long int __padding_type;
+#endif
+
#endif
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
+#include <bits/c++config.h>
#include <cstddef>
#include "tinfo.h"
#include "new" // for placement new
using namespace std;
using namespace abi;
-// initial part of a vtable, this structure is used with offsetof, so we don't
+// Initial part of a vtable, this structure is used with offsetof, so we don't
// have to keep alignments consistent manually.
-struct vtable_prefix {
- ptrdiff_t whole_object; // offset to most derived object
- const __class_type_info *whole_type; // pointer to most derived type_info
- const void *origin; // what a class's vptr points to
+struct vtable_prefix
+{
+ // Offset to most derived object.
+ ptrdiff_t whole_object;
+
+ // Additional padding if necessary.
+#ifdef _GLIBCPP_VTABLE_PADDING
+ ptrdiff_t padding1;
+#endif
+
+ // Pointer to most derived type_info.
+ const __class_type_info *whole_type;
+
+ // Additional padding if necessary.
+#ifdef _GLIBCPP_VTABLE_PADDING
+ ptrdiff_t padding2;
+#endif
+
+ // What a class's vptr points to.
+ const void *origin;
};
template <typename T>