From 98d8f793501286fde0eb1ce08170fc3523afc0b1 Mon Sep 17 00:00:00 2001 From: mccallum Date: Fri, 26 Jan 1996 15:48:29 +0000 Subject: [PATCH] (class_add_behavior): If necessary, increase instance_size of class to which behavior is being added. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@838 72102866-910b-0410-8b05-ffd578937521 --- Source/behavior.c | 6 +++++- Source/behavior.m | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Source/behavior.c b/Source/behavior.c index bfc1461ed..1d8015f0d 100644 --- a/Source/behavior.c +++ b/Source/behavior.c @@ -1,5 +1,5 @@ /* Behaviors for Objective-C, "for Protocols with implementations". - Copyright (C) 1995 Free Software Foundation, Inc. + Copyright (C) 1995, 1996 Free Software Foundation, Inc. Written by: R. Andrew McCallum Date: March 1995 @@ -91,6 +91,10 @@ class_add_behavior (Class class, Class behavior) __objc_send_initialize(class); __objc_send_initialize(behavior); + /* If necessary, increase instance_size of CLASS. */ + if (class->instance_size < behavior->instance_size) + class->instance_size = behavior->instance_size); + #if 0 /* xxx Do protocols */ if (behavior->protocols) diff --git a/Source/behavior.m b/Source/behavior.m index bfc1461ed..1d8015f0d 100644 --- a/Source/behavior.m +++ b/Source/behavior.m @@ -1,5 +1,5 @@ /* Behaviors for Objective-C, "for Protocols with implementations". - Copyright (C) 1995 Free Software Foundation, Inc. + Copyright (C) 1995, 1996 Free Software Foundation, Inc. Written by: R. Andrew McCallum Date: March 1995 @@ -91,6 +91,10 @@ class_add_behavior (Class class, Class behavior) __objc_send_initialize(class); __objc_send_initialize(behavior); + /* If necessary, increase instance_size of CLASS. */ + if (class->instance_size < behavior->instance_size) + class->instance_size = behavior->instance_size); + #if 0 /* xxx Do protocols */ if (behavior->protocols)