cd ..; $(MAKE) sublibobjc.a
OBJC_O = hash.o sarray.o class.o sendmsg.o init.o archive.o \
- selector.o objects.o misc.o Object.o Protocol.o FREED.o
+ selector.o objects.o misc.o Object.o Protocol.o
libobjc.a: $(OBJC_O)
-rm -f libobjc.a
# ranlib is run in the parent directory's makefile.
OBJC_H = hash.h list.h sarray.h objc.h \
- objc-api.h error.h \
+ objc-api.h \
Object.h Protocol.h mutex.h \
typedstream.h
/* Enforcing intentions */
- subclassResponsibility:(SEL)aSel;
- notImplemented:(SEL)aSel;
-- shouldNotImplement:(SEL)aSel;
/* Error handling */
- doesNotRecognize:(SEL)aSel;
#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);
- free
{
- static Class* freedClass = 0;
- if (!freedClass)
- freedClass = [FREED class];
- isa = freedClass;
return object_dispose(self);
}
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"
covered by the GNU General Public License. */
#include "runtime.h"
-#include "error.h"
void objc_error(id object, const char* fmt, va_list);
objc_fatal("Virtual memory exhausted\n");
return res;
}
-
-struct objc_ex_handler __ex_base_handler = {0, 0, 0, 0, 0 };
-struct objc_ex_handler* __ex_last_handler = &__ex_base_handler;
-
-objc_uncaught_exception_handler _objc_uncaught_exception_handler = 0;
-
-void
-__objc_add_handler(struct objc_ex_handler* hdlr)
-{
- hdlr->ex_prev = __ex_last_handler;
- __ex_last_handler = hdlr;
-}
-
-void
-__objc_remove_handler(struct objc_ex_handler* hdlr)
-{
- __ex_last_handler = hdlr->ex_prev;
-}
-
-#ifndef __STRICT_ANSI__
-__volatile
-#endif
-extern void __objc_raise_error(int code, const void* data1, const void* data2)
-{
- if (__ex_last_handler->ex_prev)
- {
- __ex_last_handler->code = code;
- __ex_last_handler->data1 = data1;
- __ex_last_handler->data2 = data2;
- longjmp (__ex_last_handler->ex_env, 1);
- }
- else
- {
- if (_objc_uncaught_exception_handler)
- (*_objc_uncaught_exception_handler)(code, data1, data2);
- else
- {
- printf ("uncaught exception: code=%d, data1=%x, data2=%x\n",
- code, data1, data2);
- abort();
- }
- }
-}