From 04ab39aea82bde5e7907f725c6650f96721e6a5f Mon Sep 17 00:00:00 2001 From: mccallum Date: Wed, 5 Apr 1995 00:11:36 +0000 Subject: [PATCH] Added warning in comments. (CALL_METHOD_IN_CLASS): New macro. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@272 72102866-910b-0410-8b05-ffd578937521 --- Headers/gnustep/base/behavior.h | 16 +++++++++++++++- Source/objects/behavior.h | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Headers/gnustep/base/behavior.h b/Headers/gnustep/base/behavior.h index 79a1d7eac..b5774fd2a 100644 --- a/Headers/gnustep/base/behavior.h +++ b/Headers/gnustep/base/behavior.h @@ -33,9 +33,23 @@ encounter a common ancestor.) CLASS and BEHAVIOR should share the same instance variable layout. - xxx We do not yet deal with Protocols, but we should. */ + We do not yet deal with Protocols; perhaps we should. + + The semantics of this stuff is pretty fragile. I don't recommend + that you use it in code you write. It might go away completely in + future. + +*/ + void class_add_behavior (Class class, Class behavior); +/* This macro may go away in future. + Use it carefully, you can really screw yourself up by sending to + a CLASS with a different instance variable layout than "self". */ + +#define CALL_METHOD_IN_CLASS(CLASS, METHOD, ARGS...) \ +((*imp([CLASS class], @selector(METHOD))) \ + self, @selector(METHOD), ## ARGS) /* Set to non-zero if you want debugging messages on stderr. */ void set_behavior_debug(int i); diff --git a/Source/objects/behavior.h b/Source/objects/behavior.h index 79a1d7eac..b5774fd2a 100644 --- a/Source/objects/behavior.h +++ b/Source/objects/behavior.h @@ -33,9 +33,23 @@ encounter a common ancestor.) CLASS and BEHAVIOR should share the same instance variable layout. - xxx We do not yet deal with Protocols, but we should. */ + We do not yet deal with Protocols; perhaps we should. + + The semantics of this stuff is pretty fragile. I don't recommend + that you use it in code you write. It might go away completely in + future. + +*/ + void class_add_behavior (Class class, Class behavior); +/* This macro may go away in future. + Use it carefully, you can really screw yourself up by sending to + a CLASS with a different instance variable layout than "self". */ + +#define CALL_METHOD_IN_CLASS(CLASS, METHOD, ARGS...) \ +((*imp([CLASS class], @selector(METHOD))) \ + self, @selector(METHOD), ## ARGS) /* Set to non-zero if you want debugging messages on stderr. */ void set_behavior_debug(int i);