aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-10-12 02:14:03 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-10-11 22:14:03 -0400
commitecc1211d56c8428eac06b76916dbc8d3a6456fed (patch)
treef7e79f132a1f5fa1a9f90732456954ead751b633 /gcc/cp
parentacf82af24fb759dfa802691dcba994a68c1f62c1 (diff)
downloadgcc-ecc1211d56c8428eac06b76916dbc8d3a6456fed.zip
gcc-ecc1211d56c8428eac06b76916dbc8d3a6456fed.tar.gz
gcc-ecc1211d56c8428eac06b76916dbc8d3a6456fed.tar.bz2
t-cygwin32 (TARGET_LIBGCC2_CFLAGS): Define.
* i386/t-cygwin32 (TARGET_LIBGCC2_CFLAGS): Define. (cp) * inc/typeinfo: Add #pragma interface. (operator!=): Just call operator==. * tinfo.cc: Add #pragma implementation. (operator==): Move from inc/typeinfo and tinfo2.cc. Check __COMMON_UNRELIABLE instead of _WIN32. From-SVN: r23004
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/inc/typeinfo15
-rw-r--r--gcc/cp/tinfo.cc19
-rw-r--r--gcc/cp/tinfo2.cc14
4 files changed, 28 insertions, 26 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index cfeb8e5..14abce9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
1998-10-12 Jason Merrill <jason@yorick.cygnus.com>
+ * inc/typeinfo: Add #pragma interface.
+ (operator!=): Just call operator==.
+ * tinfo.cc: Add #pragma implementation.
+ (operator==): Move from inc/typeinfo and tinfo2.cc.
+ Check __COMMON_UNRELIABLE instead of _WIN32.
+
* typeck2.c (my_friendly_abort): Add URL.
1998-10-12 Alastair J. Houghton <ajh8@doc.ic.ac.uk>
diff --git a/gcc/cp/inc/typeinfo b/gcc/cp/inc/typeinfo
index cf3b521..6c8ea05 100644
--- a/gcc/cp/inc/typeinfo
+++ b/gcc/cp/inc/typeinfo
@@ -4,6 +4,8 @@
#ifndef __TYPEINFO__
#define __TYPEINFO__
+#pragma interface "typeinfo"
+
#include <exception>
extern "C++" {
@@ -32,22 +34,11 @@ public:
bool operator!= (const type_info& arg) const;
};
-// We can't rely on common symbols being shared between translation units
-// under Windows. Sigh.
-
-#ifndef _WIN32
-inline bool type_info::
-operator== (const type_info& arg) const
-{
- return &arg == this;
-}
-
inline bool type_info::
operator!= (const type_info& arg) const
{
- return &arg != this;
+ return !operator== (arg);
}
-#endif
class bad_cast : public exception {
public:
diff --git a/gcc/cp/tinfo.cc b/gcc/cp/tinfo.cc
index 4b68fd1..2096a51 100644
--- a/gcc/cp/tinfo.cc
+++ b/gcc/cp/tinfo.cc
@@ -25,6 +25,8 @@
// This exception does not however invalidate any other reasons why
// the executable file might be covered by the GNU General Public License.
+#pragma implementation "typeinfo"
+
#include <stddef.h>
#include "tinfo.h"
#include "new" // for placement new
@@ -37,6 +39,23 @@ std::type_info::
~type_info ()
{ }
+#ifndef __COMMON_UNRELIABLE
+bool type_info::
+operator== (const type_info& arg) const
+{
+ return &arg == this;
+}
+#else
+// We can't rely on common symbols being shared between translation units
+// under Windows. Sigh.
+
+bool type_info::
+operator== (const type_info& arg) const
+{
+ return fast_compare (name (), arg.name ()) == 0;
+}
+#endif
+
extern "C" void
__rtti_class (void *addr, const char *name,
const __class_type_info::base_info *bl, size_t bn)
diff --git a/gcc/cp/tinfo2.cc b/gcc/cp/tinfo2.cc
index b797cc3..c19cf60 100644
--- a/gcc/cp/tinfo2.cc
+++ b/gcc/cp/tinfo2.cc
@@ -49,20 +49,6 @@ type_info::before (const type_info &arg) const
return fast_compare (name (), arg.name ()) < 0;
}
-#ifdef _WIN32
-bool type_info::
-operator== (const type_info& arg) const
-{
- return fast_compare (name (), arg.name ()) == 0;
-}
-
-bool type_info::
-operator!= (const type_info& arg) const
-{
- return fast_compare (name (), arg.name ()) != 0;
-}
-#endif
-
// type info for pointer type.
struct __pointer_type_info : public type_info {