Wed 09 Nov 2011 12:09:56 PM UTC, comment #16:
No problem, I just wanted to point that out...
|
Wed 09 Nov 2011 11:44:41 AM UTC, comment #15:
i did not advocate breaking pre-gcc-4.6 systems, but just extending the macro so that @optional is used on clang AND gcc > 4.6 instead of only on clang
|
Wed 09 Nov 2011 11:35:32 AM UTC, comment #14:
for example OpenBSD only ships gcc-4.2.1 in the base system, and due to licensing, there will probably never a newer version.
In the ports tree, there is only gcc-4.3, so it would not work on OpenBSD, well, clang could be used...
Sebastian
|
Wed 09 Nov 2011 11:12:59 AM UTC, comment #13:
gcc supports @optional starting with version 4.6 btw ;-)
|
Tue 08 Nov 2011 12:52:26 PM UTC, comment #12:
thanks that fixes it for me (on llvm). doesn't gcc support @optional too in recent versions?
|
Mon 07 Nov 2011 08:59:24 PM UTC, comment #11:
Being lazy myself, I just changed the code to be similar to NSNetServices.h.
|
Mon 07 Nov 2011 05:46:11 PM UTC, comment #10:
Yes, @optional is ObjC2
and yes, discrimination by feature is better than compiler version ... but I guess it means more configure tests ... and I hate trying to write them :-)
|
Mon 07 Nov 2011 05:41:54 PM UTC, comment #9:
Are you referring to the @optional attribute? We could add checks similar to those in NSNetServices.h. Although I think is is always wrong to discriminate based on the compiler and not on features.
Perhaps we need another check in configure for this.
|
Mon 07 Nov 2011 05:09:46 PM UTC, comment #8:
I think my previous comment about needing #ifdef's for different compilers was missed. Essentially the new protocol is ObjC2 specific and therefore should not be used in the vast majority of cases.
Probably the last change should be reverted (or, better, be fixed to be conditional on the presence) of an ObjC2 compiler).
|
Mon 07 Nov 2011 04:43:18 PM UTC, comment #7:
hm now i am getting a lot of warnings because i don't implement all of the delegate protocol methods. in cocoa all methods are defined as @optional as can be seen in comment #2
|
Mon 07 Nov 2011 04:07:12 PM UTC, comment #6:
The protocol was already there, all I needed to do was turn the informal protocol into a real protocol. I don't think it is worthwhile to define this differently for different base version numbers.
|
Sat 01 Oct 2011 06:27:20 AM UTC, comment #5:
PS. also bear in mind that GNUstep is portable ... so it must work on a variety of compilers (gcc-4.0.0 is the baseline) ... so any patch needs to work for different compilers and optional protocols don't work for older compilers so #ifdef's to support the different compilers are needed.
|
Thu 29 Sep 2011 02:40:03 PM UTC, comment #4:
Hmm ... when I asked for contribution ... I meant in a usable form ...
ie a diff to NSXMLParser.h which would actually compile and with indentation line lengths and use of white space conforming to the coding style standard and with comments/documentation. We also need copyright assignment if you haven't already done one.
What we can't do is just copy Apple headers!
|
Thu 29 Sep 2011 02:30:33 PM UTC, comment #3:
inline not such a god idea, attached
(file #24048)
|
Thu 29 Sep 2011 02:29:21 PM UTC, comment #2:
@protocol NSXMLParserDelegate <NSObject>
@optional
- (void)parserDidStartDocument:(NSXMLParser *)parser;
- (void)parserDidEndDocument:(NSXMLParser *)parser;
- (void)parser:(NSXMLParser )parser foundNotationDeclarationWithName:(NSString )name publicID:(NSString )publicID systemID:(NSString )systemID;
- (void)parser:(NSXMLParser )parser foundUnparsedEntityDeclarationWithName:(NSString )name publicID:(NSString )publicID systemID:(NSString )systemID notationName:(NSString *)notationName;
- (void)parser:(NSXMLParser )parser foundAttributeDeclarationWithName:(NSString )attributeName forElement:(NSString )elementName type:(NSString )type defaultValue:(NSString *)defaultValue;
- (void)parser:(NSXMLParser )parser foundElementDeclarationWithName:(NSString )elementName model:(NSString *)model;
- (void)parser:(NSXMLParser )parser foundInternalEntityDeclarationWithName:(NSString )name value:(NSString *)value;
- (void)parser:(NSXMLParser )parser foundExternalEntityDeclarationWithName:(NSString )name publicID:(NSString )publicID systemID:(NSString )systemID;
- (void)parser:(NSXMLParser )parser didStartElement:(NSString )elementName namespaceURI:(NSString )namespaceURI qualifiedName:(NSString )qName attributes:(NSDictionary *)attributeDict;
- (void)parser:(NSXMLParser )parser didEndElement:(NSString )elementName namespaceURI:(NSString )namespaceURI qualifiedName:(NSString )qName;
- (void)parser:(NSXMLParser )parser didStartMappingPrefix:(NSString )prefix toURI:(NSString *)namespaceURI;
- (void)parser:(NSXMLParser )parser didEndMappingPrefix:(NSString )prefix;
- (void)parser:(NSXMLParser )parser foundCharacters:(NSString )string;
- (void)parser:(NSXMLParser )parser foundIgnorableWhitespace:(NSString )whitespaceString;
- (void)parser:(NSXMLParser )parser foundProcessingInstructionWithTarget:(NSString )target data:(NSString *)data;
- (void)parser:(NSXMLParser )parser foundComment:(NSString )comment;
- (void)parser:(NSXMLParser )parser foundCDATA:(NSData )CDATABlock;
- (NSData )parser:(NSXMLParser )parser resolveExternalEntityName:(NSString )name systemID:(NSString )systemID;
- (void)parser:(NSXMLParser )parser parseErrorOccurred:(NSError )parseError;
- (void)parser:(NSXMLParser )parser validationErrorOccurred:(NSError )validationError;
@end
|
Thu 29 Sep 2011 02:23:12 PM UTC, comment #1:
GNUstep currently targets OSX 10.4 with some extensions from later version.
That is, you can expect all 10.4 stuff, plus quite a good sample of later additions.
The NSXMLParserDelegate protocol is a recent (10.6) addition, but if you'd care to contribute header/documentation we can certainly add it for the next release.
|
Thu 29 Sep 2011 01:27:56 PM UTC, original submission:
gnustep doesn't contain a definition of the NSXMLParserDelegate protocol
Available in Mac OS X v10.3 and later.
|