Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.

Commit e48c09d

Browse files
committed
compiles with GNUstep, doesn't link yet
1 parent 89af332 commit e48c09d

File tree

6 files changed

+23
-14
lines changed

6 files changed

+23
-14
lines changed

GNUmakefile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ include $(GNUSTEP_MAKEFILES)/common.make
44

55
LIBRARY_NAME = libMPWXmlKit
66

7+
OBJCFLAGS += -Wno-import -fobjc-runtime=gnustep
8+
79
libMPWXmlKit_HEADER_FILES = \
810
MPWSaxProtocol.h\
9-
MPWXMLAttributeGenerator.h\
1011
MPWXmlAppleProplistGenerator.h\
1112
MPWXmlAppleProplistReader.h\
1213
MPWXmlArchiver.h\
@@ -41,23 +42,20 @@ libMPWXmlKit_HEADER_FILES_DIR = .
4142
libMPWXmlKit_HEADER_FILES_INSTALL_DIR = /MPWXmlKit
4243

4344
libMPWXmlKit_OBJC_FILES = \
44-
MPWXMLAttributeGenerator.m MPWXmlAppleProplistGenerator.m\
45-
MPWXmlAppleProplistReader.m\
46-
MPWXmlArchiver.m MPWXmlAttribute.m MPWXmlAttributes.m\
47-
MPWXmlCloseTag.m MPWXmlDomParser.m MPWXmlElement.m\
48-
MPWXmlEntityReference.m MPWXmlGeneratorStream.m\
45+
MPWXmlAppleProplistGenerator.m\
46+
MPWXmlArchiver.m MPWXmlAttributes.m\
47+
MPWXmlGeneratorStream.m\
4948
MPWXmlParser.m \
5049
MPWXmlProplistGenerator.m MPWXmlSaxScanner.m\
5150
MPWXmlScanner.m \
52-
MPWXmlStartTag.m\
53-
MPWXmlTag.m MPWXmlTag2ElementProcessor.m\
5451
MPWXmlUnarchiver.m MPWXmlWrapperArchiver.m\
5552
MPWXmlWrapperUnarchiver.m\
5653

54+
5755
libMPWXmlKit_LIBRARIES_DEPEND_UPON += \
5856
-lMPWFoundation -lgnustep-base -lobjc
5957

60-
libMPWXmlKit_INCLUDE_DIRS += -I. -I..
58+
libMPWXmlKit_INCLUDE_DIRS += -I. -I.. -I../MPWFoundation/.headers/
6159
libMPWXmlKit_OBJCFLAGS += -Wno-import
6260
libMPWXmlKit_CFLAGS += -Wno-import
6361

MPWFoundation_support/MPWFastInvocation.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ -(void)dealloc
179179

180180
@end
181181

182-
@interface MPWConvenientInvocation : NSInvocation {}
182+
@interface NSInvocation(convenience)
183183
-resultOfInvoking;
184184
@end
185185

186-
@implementation MPWConvenientInvocation
186+
@implementation NSInvocation(convenience)
187187

188188
-resultOfInvoking
189189
{
@@ -322,7 +322,7 @@ +(void)testCachedInvocationFasterThanMessaging
322322
}
323323
MPWRusage* fastTime=[MPWRusage timeRelativeTo:fastStart];
324324
double ratio = (double)[slowTime userMicroseconds] / (double)[fastTime userMicroseconds];
325-
NSLog(@"cached invocation (%d) vs. plain message send (%d): %g x faster than normal message send",(int)[fastTime userMicroseconds],(int)[slowTime userMicroseconds],ratio);
325+
NSLog(@"cached invocation (%d) vs. plain message send (%d): %g x speed of normal message send",(int)[fastTime userMicroseconds],(int)[slowTime userMicroseconds],ratio);
326326
NSAssert2( ratio > 0.2 ,@"ratio of cached fast invocation to normal message send %g < %g",
327327
ratio,0.2);
328328
}

MPWXmlArchiver.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ -(void)encodeValueOfObjCType:(const char *)itemType at:(const void*)address with
211211
case 'I':
212212
valueType=@"valuetype='i'";
213213
// content = [NSString stringWithFormat:@"%D",*(unsigned int*)address];
214-
sprintf(charcontent, "%D",*(unsigned int*)address);
214+
sprintf(charcontent, "%u",*(unsigned int*)address);
215215

216216
break;
217217
case 'q':
@@ -228,7 +228,7 @@ -(void)encodeValueOfObjCType:(const char *)itemType at:(const void*)address with
228228
case 'S':
229229
valueType=@"valuetype='S'";
230230
// content = [NSString stringWithFormat:@"%D",*(unsigned short*)address];
231-
sprintf(charcontent, "%D",*(unsigned short*)address);
231+
sprintf(charcontent, "%u",*(unsigned short*)address);
232232
break;
233233
case 'f':
234234
valueType=@"valuetype='f'";

MPWXmlParser.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ -(BOOL)attributeName:(const char*)nameStart length:(long)nameLen value:(const ch
123123
id name = MAKEDATA( nameStart, nameLen );
124124
id value=nil;
125125
if ( autotranslateUTF8 && highBit) {
126+
#ifdef GS_API_LATEST
127+
value = [[[NSString alloc] initWithBytes:valueStart length:valueLen encoding:NSUTF8StringEncoding] autorelease];
128+
#else
126129
value = [(id)CFStringCreateWithBytes(NULL, (const unsigned char*)valueStart, valueLen, kCFStringEncodingUTF8, NO) autorelease];
130+
#endif
127131
}
128132
if (! value ) {
129133
value = MAKEDATA( valueStart, valueLen );

ObjectiveXML.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,7 @@
955955
1F2DB6B40AB0C52C00DA2427 /* entity_runon.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = entity_runon.txt; sourceTree = "<group>"; };
956956
1F2DB6C70AB0C65700DA2427 /* close_tag_not_closed.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = close_tag_not_closed.html; sourceTree = "<group>"; };
957957
1F2DB6C80AB0C65700DA2427 /* close_tag_not_closed.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = close_tag_not_closed.txt; sourceTree = "<group>"; };
958+
1F2F5B3421EF426C00AB0858 /* GNUmakefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GNUmakefile; sourceTree = "<group>"; };
958959
1F3466670E09BB04001FBB20 /* nested.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = nested.xml; sourceTree = "<group>"; };
959960
1F3519A90E05766900A730BF /* revision3-diggnation-quicktime.rss */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "revision3-diggnation-quicktime.rss"; sourceTree = "<group>"; };
960961
1F36076D0AC9CD51007B4CA2 /* meta_attributes.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = meta_attributes.html; sourceTree = "<group>"; };
@@ -1403,6 +1404,7 @@
14031404
07DF1A4300668979C35ADD82 /* Supporting Files */ = {
14041405
isa = PBXGroup;
14051406
children = (
1407+
1F2F5B3421EF426C00AB0858 /* GNUmakefile */,
14061408
1FB43C5B10BFBCA700490AA6 /* dllmain.m */,
14071409
07DF1A4700668979C35ADD82 /* m.template */,
14081410
07DF1A4800668979C35ADD82 /* h.template */,

makeheaderdir

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
mkdir -p .headers
3+
cd .headers
4+
apply 'ln -s %1' `find .. -type f -name '*.h' `
5+
ln -s . ObjectiveXML

0 commit comments

Comments
 (0)