Commit graph

3 commits

Author SHA1 Message Date
David Chisnall
de2a3ce038 Tidied up some compiler warnings in last commit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29172 72102866-910b-0410-8b05-ffd578937521
2009-12-27 14:41:15 +00:00
David Chisnall
a19f62698a Fixed missing } in last commit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29171 72102866-910b-0410-8b05-ffd578937521
2009-12-27 14:37:41 +00:00
David Chisnall
ea5f15deb0 Added private GSFastEnumeration header. This defines two macros that allow fast enumeration to be used inside GNUstep. Use, for example:
NSArray *a=  [NSArray arrayWithObjects: @"a", @"b", @"c", nil];
FOR_IN(NSString*, o, a)
	NSLog(@"%@", o);
END_FOR_IN(a)

This is equivalent to:

for (NSString *o in a)
{
	NSLog(@"%@", o);
}

On clang, it will be expanded to exactly that.  With GCC, it will be expanded to something equivalent to the code that Clang (or Apple GCC) would expand this to.

This is a private GNUstep header and is not intended for general use.  Outside of GNUstep, please use fast enumeration directly.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29170 72102866-910b-0410-8b05-ffd578937521
2009-12-27 14:34:10 +00:00