From patchwork Sat Oct 16 00:06:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: =?UTF-8?Q?libobjc=20-=20more=20modern=20Objective-C=20runtime=20API=20(1?= =?UTF-8?Q?0)?= Date: Fri, 15 Oct 2010 14:06:10 -0000 From: Nicola Pero X-Patchwork-Id: 68013 Message-Id: <1287187570.309415064@192.168.2.228> To: "GCC Patches" This adds a few more placeholder functions (for ivar layouts). Committed to trunk. Thanks 2010-10-16 Nicola Pero * objc/runtime.h (class_getIvarLayout): New. (class_getWeakIvarLayout): New. (class_setIvarLayout): New. (class_setWeakIvarLayout): New. * ivars.c (class_getIvarLayout): New. (class_getWeakIvarLayout): New. (class_setIvarLayout): New. (class_setWeakIvarLayout): New. Index: ChangeLog =================================================================== --- ChangeLog (revision 165531) +++ ChangeLog (working copy) @@ -1,3 +1,14 @@ +2010-10-16 Nicola Pero + + * objc/runtime.h (class_getIvarLayout): New. + (class_getWeakIvarLayout): New. + (class_setIvarLayout): New. + (class_setWeakIvarLayout): New. + * ivars.c (class_getIvarLayout): New. + (class_getWeakIvarLayout): New. + (class_setIvarLayout): New. + (class_setWeakIvarLayout): New. + 2010-10-15 Nicola Pero * objc/runtime.h (class_copyPropertyList): New. Index: ivars.c =================================================================== --- ivars.c (revision 165531) +++ ivars.c (working copy) @@ -281,3 +281,29 @@ class_copyPropertyList (Class class_ __attribute__ return NULL; } + +const char * +class_getIvarLayout (Class class_ __attribute__ ((__unused__))) +{ + return NULL; +} + +const char * +class_getWeakIvarLayout (Class class_ __attribute__ ((__unused__))) +{ + return NULL; +} + +void +class_setIvarLayout (Class class_ __attribute__ ((__unused__)), + const char *layout __attribute__ ((__unused__))) +{ + return; +} + +void +class_setWeakIvarLayout (Class class_ __attribute__ ((__unused__)), + const char *layout __attribute__ ((__unused__))) +{ + return; +} Index: objc/runtime.h =================================================================== --- objc/runtime.h (revision 165531) +++ objc/runtime.h (working copy) @@ -336,7 +336,29 @@ objc_EXPORT Property class_getProperty (Class clas objc_EXPORT Property * class_copyPropertyList (Class class_, unsigned int *numberOfReturnedProperties); +/* Return the ivar layout for class 'class_'. + At the moment this function always returns NULL. */ +objc_EXPORT const char * class_getIvarLayout (Class class_); + +/* Return the weak ivar layout for class 'class_'. + + At the moment this function always returns NULL. */ +objc_EXPORT const char * class_getWeakIvarLayout (Class class_); + +/* Set the ivar layout for class 'class_'. + + At the moment, this function does nothing. */ +objc_EXPORT void class_setIvarLayout (Class class_, const char *layout); + +/* Set the weak ivar layout for class 'class_'. + + At the moment, this function does nothing. With the GNU runtime, + you should use class_ivar_set_gcinvisible () to hide variables from + the Garbage Collector. */ +objc_EXPORT void class_setWeakIvarLayout (Class class_, const char *layout); + + /** Implementation: the following functions are in class.c. */ /* Compatibility Note: The Apple/NeXT runtime does not have