]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tinfo2.cc (fast_compare): Remove.
authorJason Merrill <jason@yorick.cygnus.com>
Sun, 25 Oct 1998 16:52:48 +0000 (16:52 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Sun, 25 Oct 1998 16:52:48 +0000 (11:52 -0500)
* tinfo2.cc (fast_compare): Remove.
(before): Just use strcmp.
* tinfo.cc (operator==): Just use strcmp.
* inc/typeinfo: Add #pragma interface.
(operator!=): Just call operator==.
* tinfo.cc: Add #pragma implementation.
(operator==): Move from inc/typeinfo and tinfo2.cc.

From-SVN: r23320

gcc/cp/ChangeLog
gcc/cp/inc/typeinfo
gcc/cp/tinfo.cc
gcc/cp/tinfo2.cc

index 3cc2f8b81186ae35431d0e87131a4c7afa2e00ac..bb915a73168c9c9b588eeb7a92c0117d036f50c1 100644 (file)
@@ -7,6 +7,23 @@
        * spew.c (yylex): Clear looking_for_typename if we got
        'enum { ... };'.
 
+1998-10-13  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * tinfo2.cc (fast_compare): Remove.
+       (before): Just use strcmp.
+       * tinfo.cc (operator==): Just use strcmp.
+
+1998-10-12  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * tinfo.cc (operator==): Always compare names.
+
+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.
+
 Fri Oct  2 02:07:26 1998  Mumit Khan  <khan@xraylith.wisc.edu>
 
        * parse.y (nomods_initdcl0): Set up the parser stack correctly.
index 64b2a819a1e2c4e37650ac46cd0696d3bb9b3e42..e46acb95df3955e24d6d5c30d6f11f8c4fc45d5e 100644 (file)
@@ -4,6 +4,8 @@
 #ifndef __TYPEINFO__
 #define __TYPEINFO__
 
+#pragma interface "typeinfo"
+
 #include <exception>
 
 extern "C++" {
@@ -34,22 +36,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:
index 4b68fd1b3fb20e2a6b581ce60b6b4bf7a17bcac7..d8380da29a4c8dc229db24e512988dea0c0a8f96 100644 (file)
@@ -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,13 @@ std::type_info::
 ~type_info ()
 { }
 
+// We can't rely on common symbols being shared between shared objects.
+bool type_info::
+operator== (const type_info& arg) const
+{
+  return (&arg == this) || (strcmp (name (), arg.name ()) == 0);
+}
+
 extern "C" void
 __rtti_class (void *addr, const char *name,
              const __class_type_info::base_info *bl, size_t bn)
index b797cc3e1dbb7f10b522d608b69ff90850a4a567..3e63354a2c5e1bd0755edbb66f8f9f8a770ec7bf 100644 (file)
 #include "new"                 // for placement new
 
 using std::type_info;
-// service function for comparing types by name.
-
-static inline int
-fast_compare (const char *n1, const char *n2) {
-  int c;
-  if (n1 == n2) return 0;
-  if (n1 == 0) return *n2;
-  else if (n2 == 0) return *n1;
-
-  c = (int)*n1++ - (int)*n2++;
-  return c == 0 ? strcmp (n1, n2) : c;
-};
 
 bool
 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;
+  return strcmp (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 {