* 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
* 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.
#ifndef __TYPEINFO__
#define __TYPEINFO__
+#pragma interface "typeinfo"
+
#include <exception>
extern "C++" {
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:
// 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
~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)
#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 {