(-shouldNotImplement:): New method
authorKresten Krab Thorup <krab@gcc.gnu.org>
Wed, 5 May 1993 13:51:43 +0000 (13:51 +0000)
committerKresten Krab Thorup <krab@gcc.gnu.org>
Wed, 5 May 1993 13:51:43 +0000 (13:51 +0000)
(-shouldNotImplement:): New method
(-free): assign [FREED class] to isa when freeing

From-SVN: r4332

gcc/objc/Object.m

index 79bbdd8..e6c90ec 100644 (file)
@@ -27,6 +27,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "objc/Protocol.h"
 #include "objc/objc-api.h"
 
+@class FREED;
+
 #include "gstdarg.h"
 extern void (*_objc_error)(id object, const char *format, va_list);
 
@@ -58,6 +60,10 @@ extern int errno;
 
 - free
 {
+  static Class* freedClass = 0;
+  if (!freedClass)
+    freedClass = [FREED class];
+  isa = freedClass;
   return object_dispose(self);
 }
 
@@ -293,6 +299,11 @@ extern int errno;
                      object_get_class_name(self), sel_get_name(aSel)];
 }
 
+- shouldNotImplement
+{
+  return [self error:"should not implement %s", sel_get_name(aSel)];
+}
+
 - error:(const char *)aString, ...
 {
 #define FMT "error: %s (%s)\n%s\n"