From edbec329363b940bed8fe3c84e9b1b2837391b69 Mon Sep 17 00:00:00 2001 From: CaS Date: Wed, 27 Nov 2002 21:39:48 +0000 Subject: [PATCH] Quick hack for setting ivars. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15158 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 4 ++++ Source/NSBundleAdditions.m | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c5cf23dc4..47bbb7be5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-11-27 Richard Frith-Macdonald + + * Source/NSBundleAdditions.m: Quick hack for setting ivars. + 2002-11-27 Adam Fedor * Source/NSTabView.m ([NSTabView -selectedTabViewItem]): Check diff --git a/Source/NSBundleAdditions.m b/Source/NSBundleAdditions.m index 30df93e0a..b32db7275 100644 --- a/Source/NSBundleAdditions.m +++ b/Source/NSBundleAdditions.m @@ -172,13 +172,21 @@ static const int currentVersion = 1; } else { + const char *nam = [_tag cString]; + const char *type; + unsigned int size; + unsigned int offset; + /* - * Use the GNUstep additional function to set the instance variable - * directly. - * FIXME - need some way to do this for libFoundation and Foundation - * based systems. + * Use the GNUstep additional function to set the instance + * variable directly. + * FIXME - need some way to do this for libFoundation and + * Foundation based systems. */ - GSSetInstanceVariable(_src, _tag, (void*)&_dst); + if (GSObjCFindInstanceVariable(_src, nam, &type, &size, &offset)) + { + GSObjCSetVariable(_src, offset, size, (void*)&_dst); + } } } }