mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
* Source/Additions/GSObjCRuntime.m (GSSelectorTypesMatch):
Ignore structure names. * Testing/nsmethodsignature.m: Added test for nested structures. Reactivated test for signatures from older gcc versions. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19891 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
977af9c25e
commit
af75d36e34
3 changed files with 21 additions and 8 deletions
|
@ -1,3 +1,10 @@
|
|||
2004-08-20 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* Source/Additions/GSObjCRuntime.m (GSSelectorTypesMatch):
|
||||
Ignore structure names.
|
||||
* Testing/nsmethodsignature.m: Added test for nested structures.
|
||||
Reactivated test for signatures from older gcc versions.
|
||||
|
||||
2004-08-19 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* Headers/Additions/GNUstepBase/GSObjCRuntime.h
|
||||
|
|
|
@ -1128,14 +1128,20 @@ GSSelectorTypesMatch(const char *types1, const char *types2)
|
|||
types1 = gs_skip_type_qualifier_and_layout_info (types1);
|
||||
types2 = gs_skip_type_qualifier_and_layout_info (types2);
|
||||
|
||||
/* Reached the end of the selector. */
|
||||
if (! *types1 && ! *types2)
|
||||
return YES;
|
||||
|
||||
/* (Ayers) This does not account for older versions of gcc
|
||||
which encoded structures as {??=<types>} while new versions replaced
|
||||
the ?? with the structure name. But it seems to expensive to
|
||||
handle that here and sel_types_match also never took this into
|
||||
account. */
|
||||
/* Ignore structure name yet compare layout. */
|
||||
if (*types1 == '{' && *types2 == '{')
|
||||
{
|
||||
while (*types1 != '=')
|
||||
types1++;
|
||||
|
||||
while (*types2 != '=')
|
||||
types2++;
|
||||
}
|
||||
|
||||
if (*types1 != *types2)
|
||||
return NO;
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
#include <Foundation/NSMethodSignature.h>
|
||||
#include <Foundation/NSRunLoop.h>
|
||||
|
@ -354,12 +353,13 @@ test_GSSelectorTypesMatch(void)
|
|||
{"@12@+0:+4:+8", "@16@4:8:12"},
|
||||
{"@12@-0:-4:-8", "@16@4:8:12"},
|
||||
|
||||
{"{_MyLargeStruct2={_MyLargeStruct=dd}dd}@:",
|
||||
"{??={??=dd}dd}16@0:4"},
|
||||
|
||||
{"{_MyLargeStruct=dd}56@+8:+12@+16c+23s+26i+28l24f28d32{_MyLargeStruct=dd}40{_MySmallStruct=c}44",
|
||||
"{_MyLargeStruct=dd}46@+8:+12@+16c+17s+16i+20l+24f+28d24{_MyLargeStruct=dd}32{_MySmallStruct=c}45"},
|
||||
/* This comparison is currently not supported.
|
||||
{"{_MyLargeStruct=dd}56@+8:+12@+16c+23s+26i+28l24f28d32{_MyLargeStruct=dd}40{_MySmallStruct=c}44",
|
||||
"{??=dd}46@+8:+12@+16c+17s+16i+20l+24f+28d24{??=dd}32{??=c}45"},
|
||||
*/
|
||||
{0, 0} };
|
||||
unsigned int i = 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue