[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[swarm-cvs] [7943] use NSInvocation instead of avcall on OpenStep, fix 6
From: |
Scott Christley |
Subject: |
[swarm-cvs] [7943] use NSInvocation instead of avcall on OpenStep, fix 64-bit on Mac OSX |
Date: |
Wed, 14 Mar 2012 22:19:17 +0000 |
Revision: 7943
http://svn.sv.gnu.org/viewvc/?view=rev&root=swarm&revision=7943
Author: schristley
Date: 2012-03-14 22:19:17 +0000 (Wed, 14 Mar 2012)
Log Message:
-----------
use NSInvocation instead of avcall on OpenStep, fix 64-bit on Mac OSX
Modified Paths:
--------------
trunk/swarm/macosx/SwarmOSX/Swarm.xcodeproj/project.pbxproj
trunk/swarm/src/activity/Action.h
trunk/swarm/src/activity/Action.m
trunk/swarm/src/activity/ActionGroup.m
trunk/swarm/src/activity/ChangeLog
trunk/swarm/src/activity/activity.m
trunk/swarm/src/defobj/Arguments.m
trunk/swarm/src/defobj/ChangeLog
trunk/swarm/src/defobj/DefClass.h
trunk/swarm/src/defobj/Program.h
trunk/swarm/src/defobj/Program.m
trunk/swarm/src/defobj/_fcall.m
trunk/swarm/src/defobj/make-h2x
trunk/swarm/src/defobj/swarm-objc-api.h
trunk/swarm/src/defobj/swarm-objc-apple.m
trunk/swarm/src/defobj/swarm-objc-apple2.h
Modified: trunk/swarm/macosx/SwarmOSX/Swarm.xcodeproj/project.pbxproj
===================================================================
--- trunk/swarm/macosx/SwarmOSX/Swarm.xcodeproj/project.pbxproj 2011-03-04
18:03:23 UTC (rev 7942)
+++ trunk/swarm/macosx/SwarmOSX/Swarm.xcodeproj/project.pbxproj 2012-03-14
22:19:17 UTC (rev 7943)
@@ -304,7 +304,7 @@
D63BA7AD0E17108600E0FC0E /* structcpy.c in Sources */ = {isa =
PBXBuildFile; fileRef = D63BA7AC0E17108600E0FC0E /* structcpy.c */; };
D675AEAF0E1068A700578367 /* swarm-objc-apple.m in Sources */ =
{isa = PBXBuildFile; fileRef = D675AEAE0E1068A700578367 /* swarm-objc-apple.m
*/; };
D675AF080E10797700578367 /* SwarmTop.h in Headers */ = {isa =
PBXBuildFile; fileRef = D675AF070E10797700578367 /* SwarmTop.h */; settings =
{ATTRIBUTES = (Public, ); }; };
- D69B41000E26ADAF00953B0F /* avcall-i386.S in Sources */ = {isa
= PBXBuildFile; fileRef = D63BA7C20E17121B00E0FC0E /* avcall-i386.S */; };
+ D686CBD112F74BAE00353301 /* libhdf5.dylib in Frameworks */ =
{isa = PBXBuildFile; fileRef = D686CBD012F74BAE00353301 /* libhdf5.dylib */; };
D6B169620E21737B00573BB9 /* modulemap.c in Sources */ = {isa =
PBXBuildFile; fileRef = D6B169610E21737B00573BB9 /* modulemap.c */; };
D6EAF9A00981D86A00EE3B51 /* SwarmEnvironment_getters.h in
Headers */ = {isa = PBXBuildFile; fileRef = D615E38B08CBF48F00E2534C /*
SwarmEnvironment_getters.h */; };
D6EAF9A30981D87400EE3B51 /* SwarmEnvironment_getters.m in
Headers */ = {isa = PBXBuildFile; fileRef = D615E38C08CBF48F00E2534C /*
SwarmEnvironment_getters.m */; };
@@ -404,7 +404,7 @@
D615D74F08C6C13800E2534C /* strnlen.c */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path =
strnlen.c; sourceTree = "<group>"; };
D615D75208C6C13800E2534C /* strtoll.c */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path =
strtoll.c; sourceTree = "<group>"; };
D615D75308C6C13800E2534C /* xmalloc.c */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path =
xmalloc.c; sourceTree = "<group>"; };
- D615D78608C6C28900E2534C /* swarmconfig.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name =
swarmconfig.h; path = build/swarmconfig.h; sourceTree = SOURCE_ROOT; };
+ D615D78608C6C28900E2534C /* swarmconfig.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name =
swarmconfig.h; path = ../../swarmconfig.h; sourceTree = SOURCE_ROOT; };
D615D7B808C6C6CB00E2534C /* _fcall.m */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc;
path = _fcall.m; sourceTree = "<group>"; };
D615D7B908C6C6CB00E2534C /* Archiver.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path =
Archiver.h; sourceTree = "<group>"; };
D615D7BA08C6C6CB00E2534C /* Archiver.m */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc;
path = Archiver.m; sourceTree = "<group>"; };
@@ -613,17 +613,17 @@
D615DA4C08C6C73F00E2534C /* SwarmProcess.m */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc;
path = SwarmProcess.m; sourceTree = "<group>"; };
D615DA4D08C6C73F00E2534C /* XActivity.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path =
XActivity.h; sourceTree = "<group>"; };
D615DA4E08C6C73F00E2534C /* XActivity.m */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc;
path = XActivity.m; sourceTree = "<group>"; };
- D615DA6108C6C7B300E2534C /* externvar.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name =
externvar.h; path = build/externvar.h; sourceTree = "<group>"; };
- D615DA9408C6CD5600E2534C /* defobj_types.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name =
defobj_types.h; path = build/src/defobj/defobj_types.h; sourceTree =
SOURCE_ROOT; };
- D615DAB108C913F400E2534C /* collections_types.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name =
collections_types.h; path = build/src/collections/collections_types.h;
sourceTree = SOURCE_ROOT; };
- D615DAB408C9144700E2534C /* collections_classes.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name =
collections_classes.h; path = build/src/collections/collections_classes.h;
sourceTree = SOURCE_ROOT; };
- D615DAC908C91A8900E2534C /* defobj_classes.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name =
defobj_classes.h; path = build/src/defobj/defobj_classes.h; sourceTree =
SOURCE_ROOT; };
- D615DACB08C91A9100E2534C /* defobj.xm */ = {isa =
PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name =
defobj.xm; path = build/src/defobj/defobj.xm; sourceTree = SOURCE_ROOT; };
- D615DACE08C91AC800E2534C /* version.h */ = {isa =
PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name =
version.h; path = build/src/defobj/version.h; sourceTree = SOURCE_ROOT; };
- D615DB7808CA092B00E2534C /* activity_types.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name =
activity_types.h; path = build/src/activity/activity_types.h; sourceTree =
SOURCE_ROOT; };
- D615DB7A08CA093300E2534C /* activity.xm */ = {isa =
PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name =
activity.xm; path = build/src/activity/activity.xm; sourceTree = SOURCE_ROOT; };
- D615DB7C08CA094300E2534C /* activity_classes.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name =
activity_classes.h; path = build/src/activity/activity_classes.h; sourceTree =
SOURCE_ROOT; };
- D615DB9C08CA57AC00E2534C /* collections.xm */ = {isa =
PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name =
collections.xm; path = build/src/collections/collections.xm; sourceTree =
SOURCE_ROOT; };
+ D615DA6108C6C7B300E2534C /* externvar.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name =
externvar.h; path = ../../externvar.h; sourceTree = "<group>"; };
+ D615DA9408C6CD5600E2534C /* defobj_types.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path =
defobj_types.h; sourceTree = "<group>"; };
+ D615DAB108C913F400E2534C /* collections_types.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path =
collections_types.h; sourceTree = "<group>"; };
+ D615DAB408C9144700E2534C /* collections_classes.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path =
collections_classes.h; sourceTree = "<group>"; };
+ D615DAC908C91A8900E2534C /* defobj_classes.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path =
defobj_classes.h; sourceTree = "<group>"; };
+ D615DACB08C91A9100E2534C /* defobj.xm */ = {isa =
PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; path =
defobj.xm; sourceTree = "<group>"; };
+ D615DACE08C91AC800E2534C /* version.h */ = {isa =
PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name =
version.h; path = ../../src/defobj/version.h; sourceTree = SOURCE_ROOT; };
+ D615DB7808CA092B00E2534C /* activity_types.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path =
activity_types.h; sourceTree = "<group>"; };
+ D615DB7A08CA093300E2534C /* activity.xm */ = {isa =
PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; path =
activity.xm; sourceTree = "<group>"; };
+ D615DB7C08CA094300E2534C /* activity_classes.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path =
activity_classes.h; sourceTree = "<group>"; };
+ D615DB9C08CA57AC00E2534C /* collections.xm */ = {isa =
PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; path =
collections.xm; sourceTree = "<group>"; };
D615DEBA08CAB04C00E2534C /* AppendFile.h */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path =
AppendFile.h; sourceTree = "<group>"; };
D615DEBB08CAB04C00E2534C /* AppendFile.m */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc;
path = AppendFile.m; sourceTree = "<group>"; };
D615DEBC08CAB04C00E2534C /* ChangeLog */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path =
ChangeLog; sourceTree = "<group>"; };
@@ -722,6 +722,7 @@
D615E37E08CBF32C00E2534C /* SwarmEnvironment.m */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc;
name = SwarmEnvironment.m; path = ../../src/SwarmEnvironment.m; sourceTree =
SOURCE_ROOT; };
D615E38B08CBF48F00E2534C /* SwarmEnvironment_getters.h */ =
{isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h;
name = SwarmEnvironment_getters.h; path = ../../src/SwarmEnvironment_getters.h;
sourceTree = SOURCE_ROOT; };
D615E38C08CBF48F00E2534C /* SwarmEnvironment_getters.m */ =
{isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30;
name = SwarmEnvironment_getters.m; path = ../../src/SwarmEnvironment_getters.m;
sourceTree = "<group>"; };
+ D6171C1214CF570A006D9162 /* avcall-x86_64.c */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path =
"avcall-x86_64.c"; sourceTree = "<group>"; };
D618622A0DD4F502006B1C2F /* swarm-objc-api.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
"swarm-objc-api.h"; sourceTree = "<group>"; };
D618622B0DD4F502006B1C2F /* swarm-objc-apple.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
"swarm-objc-apple.h"; sourceTree = "<group>"; };
D618622C0DD4F502006B1C2F /* swarm-objc-apple2.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
"swarm-objc-apple2.h"; sourceTree = "<group>"; };
@@ -731,6 +732,7 @@
D63BA7C20E17121B00E0FC0E /* avcall-i386.S */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path =
"avcall-i386.S"; sourceTree = SOURCE_ROOT; };
D675AEAE0E1068A700578367 /* swarm-objc-apple.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path
= "swarm-objc-apple.m"; sourceTree = "<group>"; };
D675AF070E10797700578367 /* SwarmTop.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name =
SwarmTop.h; path = ../../src/SwarmTop.h; sourceTree = SOURCE_ROOT; };
+ D686CBD012F74BAE00353301 /* libhdf5.dylib */ = {isa =
PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name =
libhdf5.dylib; path = /usr/local/lib/libhdf5.dylib; sourceTree = "<absolute>";
};
D6B169610E21737B00573BB9 /* modulemap.c */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path =
modulemap.c; sourceTree = "<group>"; };
D6BBBF67097F41CE005298EA /* include.dists.creating.m */ = {isa
= PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc;
path = include.dists.creating.m; sourceTree = "<group>"; };
D6BBBF68097F41CE005298EA /* include.dists.setting.m */ = {isa =
PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc;
path = include.dists.setting.m; sourceTree = "<group>"; };
@@ -823,6 +825,7 @@
buildActionMask = 2147483647;
files = (
8DC2EF570486A6940098B216 /* Cocoa.framework in
Frameworks */,
+ D686CBD112F74BAE00353301 /* libhdf5.dylib in
Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -857,6 +860,7 @@
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries
*/ = {
isa = PBXGroup;
children = (
+ D686CBD012F74BAE00353301 /* libhdf5.dylib */,
1058C7B0FEA5585E11CA2CBB /* Linked Frameworks
*/,
1058C7B2FEA5585E11CA2CBB /* Other Frameworks */,
);
@@ -912,6 +916,7 @@
isa = PBXGroup;
children = (
D63BA7C20E17121B00E0FC0E /* avcall-i386.S */,
+ D6171C1214CF570A006D9162 /* avcall-x86_64.c */,
D63BA7AC0E17108600E0FC0E /* structcpy.c */,
D675AF070E10797700578367 /* SwarmTop.h */,
D615E38B08CBF48F00E2534C /*
SwarmEnvironment_getters.h */,
@@ -1780,7 +1785,14 @@
isa = PBXProject;
buildConfigurationList = D615D71D08C6BFEC00E2534C /*
Build configuration list for PBXProject "Swarm" */;
compatibilityVersion = "Xcode 2.4";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
mainGroup = 0867D691FE84028FC02AAC07 /* Swarm */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products
*/;
projectDirPath = "";
@@ -1861,7 +1873,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "../../autogen.sh\nexit 0";
+ shellScript = "# the proper version of the tools may
not be in the path\n#../../autogen.sh\nexit 0\n";
};
7909CE08112B94C6009F123A /* Configure */ = {
isa = PBXShellScriptBuildPhase;
@@ -1877,7 +1889,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "./configure.sh\nexit 0";
+ shellScript = "#./configure.sh\nexit 0";
};
D6EAF86B0981C20400EE3B51 /* Make headers */ = {
isa = PBXShellScriptBuildPhase;
@@ -1891,7 +1903,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "#\n# Swarm\n#\n\n#pwd >
~/junk\nresult=0\n\ncd build\nln -s ./ Swarm\n\ncd src\nmake headers\nif [ $?
-ne 0 ]; then result=$?; fi\ncd defobj\nmake version.h\nif [ $? -ne 0 ]; then
result=$?; fi\nmake modulemap.c\nif [ $? -ne 0 ]; then result=$?; fi\n\nexit
$result\n";
+ shellScript = "#\n# Swarm\n#\n\n#pwd > ~/junk\n#env >
~/junkenv\nresult=0\n\n#cd build\n#ln -s ./ Swarm\n\ncd ../../src\nmake
headers\nif [ $? -ne 0 ]; then result=$?; fi\ncd defobj\nmake version.h\nif [
$? -ne 0 ]; then result=$?; fi\nmake modulemap.c\nif [ $? -ne 0 ]; then
result=$?; fi\n\nexit $result\n";
};
/* End PBXShellScriptBuildPhase section */
@@ -2037,7 +2049,6 @@
D675AEAF0E1068A700578367 /* swarm-objc-apple.m
in Sources */,
D63BA7AD0E17108600E0FC0E /* structcpy.c in
Sources */,
D6B169620E21737B00573BB9 /* modulemap.c in
Sources */,
- D69B41000E26ADAF00953B0F /* avcall-i386.S in
Sources */,
D6EFA56B0F98F9C6002997C4 /* Object2dDisplay.m
in Sources */,
D6EFA56D0F98F9C6002997C4 /* openstep.m in
Sources */,
D6EFA56F0F98F9C6002997C4 /* OpenStepSwarm.m in
Sources */,
@@ -2064,7 +2075,6 @@
D615D71A08C6BFEC00E2534C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ONLY_ACTIVE_ARCH_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "ppc
i386 ppc64 x86_64";
COPY_PHASE_STRIP = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -2082,6 +2092,7 @@
GCC_WARN_INHIBIT_ALL_WARNINGS = NO;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
+ ../..,
"${BUILT_PRODUCTS_DIR}/../src/defobj",
../../avcall,
"${BUILT_PRODUCTS_DIR}/../avcall",
@@ -2094,13 +2105,13 @@
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Frameworks";
LIBRARY_SEARCH_PATHS = (
+ /usr/local/lib,
/opt/local/lib,
"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
);
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 =
"\"$(SRCROOT)/../../avcall\"";
LIBRARY_STYLE = DYNAMIC;
MACH_O_TYPE = mh_dylib;
- ONLY_ACTIVE_ARCH_PRE_XCODE_3_1 =
"$(NATIVE_ARCH)";
PREBINDING = NO;
PRODUCT_NAME = Swarm;
VALID_ARCHS = "ppc64 ppc7400 ppc970 i386 x86_64
ppc";
@@ -2146,8 +2157,8 @@
D615D71E08C6BFEC00E2534C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ONLY_ACTIVE_ARCH_PRE_XCODE_3_1)";
- ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "ppc
i386 ppc64 x86_64";
+ ARCHS =
"$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 =
"x86_64 i386 ppc";
GCC_PREPROCESSOR_DEFINITIONS = "";
HEADER_SEARCH_PATHS = (
../../avcall,
@@ -2157,7 +2168,7 @@
/usr/include/ffi,
);
MACOSX_DEPLOYMENT_TARGET = 10.5;
- ONLY_ACTIVE_ARCH_PRE_XCODE_3_1 =
"$(NATIVE_ARCH)";
+ ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = "-fnested-functions";
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
VALID_ARCHS = "ppc64 ppc7400 ppc970 i386 x86_64
ppc";
Modified: trunk/swarm/src/activity/Action.h
===================================================================
--- trunk/swarm/src/activity/Action.h 2011-03-04 18:03:23 UTC (rev 7942)
+++ trunk/swarm/src/activity/Action.h 2012-03-14 22:19:17 UTC (rev 7943)
@@ -47,6 +47,9 @@
id <FCall> call;
IMP perform_imp;
id target;
+#if SWARM_OSX
+ NSInvocation *anInvocation;
+#endif
}
- createEnd;
@end
Modified: trunk/swarm/src/activity/Action.m
===================================================================
--- trunk/swarm/src/activity/Action.m 2011-03-04 18:03:23 UTC (rev 7942)
+++ trunk/swarm/src/activity/Action.m 2012-03-14 22:19:17 UTC (rev 7943)
@@ -115,12 +115,21 @@
PHASE(Using)
- (void)_addArguments_: (id <FArguments>)arguments
{
+#if SWARM_OSX
if (argCount >= 1)
+ [anInvocation setArgument: &arg1 atIndex: 2];
+ if (argCount >= 2)
+ [anInvocation setArgument: &arg2 atIndex: 3];
+ if (argCount >= 3)
+ [anInvocation setArgument: &arg3 atIndex: 4];
+#else
+ if (argCount >= 1)
[arguments addObject: arg1];
if (argCount >= 2)
[arguments addObject: arg2];
if (argCount >= 3)
[arguments addObject: arg3];
+#endif
}
- (void)_performAction_: (id <Activity>)anActivity
@@ -302,6 +311,14 @@
- _createCall_: theTarget
{
+#if SWARM_OSX
+ anInvocation = [[NSInvocation invocationWithMethodSignature:
+ [theTarget methodSignatureForSelector: selector]] retain];
+ [anInvocation setTarget: theTarget];
+ [anInvocation setSelector: selector];
+ [self _addArguments_: nil];
+ return nil;
+#else
id <FArguments> arguments =
[FArguments createBegin: getCZone (getZone (self))];
@@ -321,11 +338,20 @@
target: theTarget
selector: selector
arguments: arguments];
+#endif
}
PHASE(Using)
- (void)_performAction_: (id <Activity>)anActivity
{
+#if SWARM_OSX
+ if (anInvocation) {
+ [anInvocation invokeWithTarget: target];
+ } else {
+ [self _createCall_: target];
+ [anInvocation invoke];
+ }
+#else
if (call)
{
updateTarget ((FCall_c *)call, target);
@@ -339,6 +365,7 @@
[[fc getArguments] dropAllocations: YES];
[fc dropAllocations: YES];
}
+#endif
}
- getTarget
Modified: trunk/swarm/src/activity/ActionGroup.m
===================================================================
--- trunk/swarm/src/activity/ActionGroup.m 2011-03-04 18:03:23 UTC (rev
7942)
+++ trunk/swarm/src/activity/ActionGroup.m 2012-03-14 22:19:17 UTC (rev
7943)
@@ -46,7 +46,11 @@
if (createByMessageToCopy (self, createEnd))
return self;
+#if SWARM_OBJC_DONE
[(id) self setIndexFromMemberLoc: offsetof (CAction, ownerActions)];
+#else
+ [(id) self setIndexFromMemberLoc:
ivar_getOffset(class_getInstanceVariable([CAction class], "ownerActions"))];
+#endif
setNextPhase (self);
setMappedAlloc (self);
return self;
@@ -364,7 +368,11 @@
if (createByMessageToCopy (self, createEnd))
return self;
+#if SWARM_OBJC_DONE
[(id) self setIndexFromMemberLoc: offsetof (CAction, ownerActions)];
+#else
+ [(id) self setIndexFromMemberLoc:
ivar_getOffset(class_getInstanceVariable([CAction class], "ownerActions"))];
+#endif
setMappedAlloc (self);
setNextPhase (self);
return self;
Modified: trunk/swarm/src/activity/ChangeLog
===================================================================
--- trunk/swarm/src/activity/ChangeLog 2011-03-04 18:03:23 UTC (rev 7942)
+++ trunk/swarm/src/activity/ChangeLog 2012-03-14 22:19:17 UTC (rev 7943)
@@ -1,3 +1,9 @@
+2012-3-14 Scott Christley <address@hidden>
+
+ * ActionGroup.m, activity.m: Get correct ivar offset.
+
+ * Action.[hm]: Use NSInvocation for OpenStep.
+
2009-11-24 Scott Christley <address@hidden>
* activity.h: Use activity directory to include generated file on
Modified: trunk/swarm/src/activity/activity.m
===================================================================
--- trunk/swarm/src/activity/activity.m 2011-03-04 18:03:23 UTC (rev 7942)
+++ trunk/swarm/src/activity/activity.m 2012-03-14 22:19:17 UTC (rev 7943)
@@ -65,13 +65,23 @@
_activity_zone = globalZone;
_activity_activityRefsType = [OrderedSet customizeBegin: globalZone];
+#if SWARM_OBJC_DONE
[_activity_activityRefsType
- setIndexFromMemberLoc: offsetof (Activity_c, activityRefs)];
+ setIndexFromMemberLoc: offsetof (Activity_c, activityRefs)];
+#else
+ [_activity_activityRefsType
+ setIndexFromMemberLoc:
ivar_getOffset(class_getInstanceVariable([Activity_c class], "activityRefs"))];
+#endif
_activity_activityRefsType = [_activity_activityRefsType customizeEnd];
_activity_activitySetRefsType = [OrderedSet customizeBegin: globalZone];
+#if SWARM_OBJC_DONE
[_activity_activitySetRefsType
- setIndexFromMemberLoc: offsetof (Activity_c, activitySetRefs)];
+ setIndexFromMemberLoc: offsetof (Activity_c, activitySetRefs)];
+#else
+ [_activity_activitySetRefsType
+ setIndexFromMemberLoc:
ivar_getOffset(class_getInstanceVariable([Activity_c class],
"activitySetRefs"))];
+#endif
_activity_activitySetRefsType = [_activity_activitySetRefsType customizeEnd];
_activity_swarmSyncType = [Schedule customizeBegin: globalZone];
Modified: trunk/swarm/src/defobj/Arguments.m
===================================================================
--- trunk/swarm/src/defobj/Arguments.m 2011-03-04 18:03:23 UTC (rev 7942)
+++ trunk/swarm/src/defobj/Arguments.m 2012-03-14 22:19:17 UTC (rev 7943)
@@ -124,6 +124,17 @@
// foreign targets. It is one of the few cases where Swarm
// sends a message outside of the Action framework.
+#if SWARM_OSX
+ error_t ret;
+ NSInvocation *inv = [NSInvocation invocationWithMethodSignature:
+ [arguments methodSignatureForSelector:
M(parseKey:arg:)]];
+ [inv setSelector: M(parseKey:arg:)];
+ [inv setArgument: &key atIndex: 2];
+ [inv setArgument: &arg atIndex: 3];
+ [inv invokeWithTarget: arguments];
+ [inv getReturnValue: &ret];
+ return ret;
+#else
id fa = [FArguments createBegin: getCZone (scratchZone)];
id fc;
error_t ret;
@@ -153,6 +164,7 @@
[fc drop];
[fa drop];
return ret;
+#endif
}
@implementation Arguments_c
@@ -388,6 +400,9 @@
optionFunc: (int (*) (int key, const char *arg))anOptionFunc
inhibitExecutableSearchFlag: (BOOL)theInhibitExecutableSearchFlag
{
+#if SWARM_OSX
+ NSAutoreleasePool *pool = [NSAutoreleasePool new];
+#endif
Arguments_c *argobj = [self createBegin: globalZone];
[argobj setArgc: theArgc Argv: theArgv];
@@ -398,7 +413,12 @@
[argobj setVersion: theVersion];
[argobj setAppName: theAppName];
[argobj setInhibitExecutableSearchFlag: theInhibitExecutableSearchFlag];
- return [argobj createEnd];
+ id a = [argobj createEnd];
+
+#if SWARM_OSX
+ [pool drain];
+#endif
+ return a;
}
PHASE(Setting)
Modified: trunk/swarm/src/defobj/ChangeLog
===================================================================
--- trunk/swarm/src/defobj/ChangeLog 2011-03-04 18:03:23 UTC (rev 7942)
+++ trunk/swarm/src/defobj/ChangeLog 2012-03-14 22:19:17 UTC (rev 7943)
@@ -1,3 +1,23 @@
+2012-3-14 Scott Christley <address@hidden>
+
+ * Arguments.m: Use NSInvocation on OpenStep, which requires an
+ autorelease pool so memory is leaked during argument parsing.
+
+ * swarm-objc-api.h: Add protocol functions.
+ * swarm-objc-apple2.h: Likewise.
+
+ * swarm-objc-apple.m: Get proper alignment when copying ivar info.
+
+ * Program.h: Need to inherit from NSObject for OpenStep.
+ * DefClass.h: Likewise.
+
+ * Program.m: Copy protocols.
+
+ * _fcall.m: Do not use avcall on OpenStep.
+
+ * make-h2x: Protocols not constant on 64-bit Mac OSX, so assign
+ values at runtime.
+
2010-04-11 Marcus G. Daniels <address@hidden>
* Arguments.m: Look for signature (swarmconfig.h) in Swarm/.
Modified: trunk/swarm/src/defobj/DefClass.h
===================================================================
--- trunk/swarm/src/defobj/DefClass.h 2011-03-04 18:03:23 UTC (rev 7942)
+++ trunk/swarm/src/defobj/DefClass.h 2012-03-14 22:19:17 UTC (rev 7943)
@@ -26,6 +26,8 @@
#import <Swarm/swarm-objc-api.h>
#import <objc/Object.h>
+#import <Swarm/swarmconfig.h>
+
//
// type declarations
//
@@ -35,7 +37,11 @@
//
// Class_s -- portion of class object allocated for all created classes
//
+#if SWARM_OSX
address@hidden Class_s: NSObject
+#else
@interface Class_s: Object
+#endif
{
@public
Class_s *superclass; // object for [super ...] dispatch
Modified: trunk/swarm/src/defobj/Program.h
===================================================================
--- trunk/swarm/src/defobj/Program.h 2011-03-04 18:03:23 UTC (rev 7942)
+++ trunk/swarm/src/defobj/Program.h 2012-03-14 22:19:17 UTC (rev 7943)
@@ -50,7 +50,11 @@
- (const char *)getName;
@end
+#if SWARM_OSX
address@hidden ProgramModule_c: NSObject
+#else
@interface ProgramModule_c: Object
+#endif
{
@public
const char *name; // name of module
Modified: trunk/swarm/src/defobj/Program.m
===================================================================
--- trunk/swarm/src/defobj/Program.m 2011-03-04 18:03:23 UTC (rev 7942)
+++ trunk/swarm/src/defobj/Program.m 2012-03-14 22:19:17 UTC (rev 7943)
@@ -322,13 +322,18 @@
**typeID = [_obj_initZone allocIVars: id_Type_c];
type = **typeID;
type->owner = moduleObject;
+#if SWARM_OBJC_DONE
type->name = (*(proto_t *) protocol)->name;
+#else
+ type->name = swarm_protocol_getName(*protocol);
+ if (type->name) printf("Protocol: %s\n", type->name);
+#endif
type->typeID = *typeID;
type->supertypes = *protocol;
// also mark whether type is creatable based on protocol declaration
-#if SWARM_OBJC_TODO
+#if SWARM_OBJC_DONE
for (protoList = (*(proto_t *) protocol)->protoList;
protoList; protoList = protoList->next)
{
@@ -341,6 +346,17 @@
type->implementation = Creating;
}
}
+#else
+ unsigned int outCount;
+ ObjcProtocol **pList = swarm_protocol_copyProtocolList(*protocol,
&outCount);
+ int i = 0;
+ for (i = 0; i < outCount; ++i) {
+ printf("Protocol list: %s\n", swarm_protocol_getName(pList[i]));
+ if ((strcmp (swarm_protocol_getName(pList[i]), "CREATABLE") == 0)
+ || strcmp (swarm_protocol_getName(pList[i]), "RETURNABLE") == 0)
+ type->implementation = Creating;
+ }
+ if (pList) free(pList);
#endif
}
Modified: trunk/swarm/src/defobj/_fcall.m
===================================================================
--- trunk/swarm/src/defobj/_fcall.m 2011-03-04 18:03:23 UTC (rev 7942)
+++ trunk/swarm/src/defobj/_fcall.m 2012-03-14 22:19:17 UTC (rev 7943)
@@ -196,5 +196,10 @@
void
AV_CALL (FArguments_c *fa)
{
+#if SWARM_OSX
+ printf("av_call not supported on OSX.\n");
+ abort();
+#else
av_call (AVALIST (fa));
+#endif
}
Modified: trunk/swarm/src/defobj/make-h2x
===================================================================
--- trunk/swarm/src/defobj/make-h2x 2011-03-04 18:03:23 UTC (rev 7942)
+++ trunk/swarm/src/defobj/make-h2x 2012-03-14 22:19:17 UTC (rev 7943)
@@ -69,7 +69,7 @@
# extract all declared types into temporary file
-$GSED <$srcdir/$m.h >$m.xm+ \
+$GSED <$srcdir/$m.h >$m.xp \
-e 's/ //g' \
-e '/address@hidden/!d' \
-e 's/@protocol[ *]\([A-Za-z0-9_][A-Za-z0-9_]*\).*/\1/'
@@ -78,7 +78,7 @@
echo 'extern void *_'$m'_[];
' >$m.xt
-$GSED <$m.xm+ >>$m.xt \
+$GSED <$m.xp >>$m.xt \
-e 's/^Zone/SwarmZone/' \
-e 's/^EventType/SwarmEventType/' \
-e 's/^Collection/SwarmCollection/' \
@@ -90,7 +90,7 @@
# define type identifiers in generated file
-$GSED <$m.xm+ >>$m.xm \
+$GSED <$m.xp >>$m.xm \
-e 's/^Zone/SwarmZone/' \
-e 's/^EventType/SwarmEventType/' \
-e 's/^Collection/SwarmCollection/' \
@@ -100,13 +100,13 @@
echo '
void *_'$m'_types[]={' >>$m.xm
-$GSED <$m.xm+ >>$m.xm \
+$GSED <$m.xp >>$m.xm \
-e 's/Zone/SwarmZone/' \
-e 's/^EventType/SwarmEventType/' \
-e 's/^Collection/SwarmCollection/' \
-e 's/\(.*\)/\&\1,/'
echo 0, >>$m.xm
-$GSED 's/\(.*\)/@protocol(\1),/' <$m.xm+ >>$m.xm
+$GSED 's/\(.*\)/0,/' <$m.xp >>$m.xm
echo '0};
' >>$m.xm
@@ -176,6 +176,12 @@
@implementation Module__'$m'_
+ initialize
{
+ int i = 0;
+ while (_'$m'_types[i]) ++i;
+ ++i;
+// initialize protocols pointers, not constant on some platforms' >>$m.xm
+$GSED 's/\(.*\)/_'$m'address@hidden(\1);/' <$m.xp >>$m.xm
+echo '
// initialize class id constants and link all classes into module' >>$m.xm
$GSED 's/\(.*\)/id_\1=[\1 self];/' <$m.xm+ >>$m.xm
echo '
@@ -189,4 +195,4 @@
# remove temporary file containing class names
-rm $m.xm+
+rm $m.xm+ $m.xp
Modified: trunk/swarm/src/defobj/swarm-objc-api.h
===================================================================
--- trunk/swarm/src/defobj/swarm-objc-api.h 2011-03-04 18:03:23 UTC (rev
7942)
+++ trunk/swarm/src/defobj/swarm-objc-api.h 2012-03-14 22:19:17 UTC (rev
7943)
@@ -259,6 +259,12 @@
const char *
swarm_protocol_getName (ObjcProtocol *);
+BOOL
+swarm_protocol_isEqual(ObjcProtocol *proto, ObjcProtocol *other);
+
+ObjcProtocol **
+swarm_protocol_copyProtocolList(ObjcProtocol *proto, unsigned int *outCount);
+
// Working with properties
Modified: trunk/swarm/src/defobj/swarm-objc-apple.m
===================================================================
--- trunk/swarm/src/defobj/swarm-objc-apple.m 2011-03-04 18:03:23 UTC (rev
7942)
+++ trunk/swarm/src/defobj/swarm-objc-apple.m 2012-03-14 22:19:17 UTC (rev
7943)
@@ -59,16 +59,16 @@
swarm_class_copyIvars (Class fromClass, Class toClass)
{
unsigned int i, outCount;
- unsigned int aSize, anAlign;
+ NSUInteger aSize, anAlign;
// copy the instance variables from one class to the other
Ivar *ivarList = class_copyIvarList(fromClass, &outCount);
if (ivarList) {
for (i = 0; i < outCount; ++i) {
NSGetSizeAndAlignment(ivar_getTypeEncoding(ivarList[i]), &aSize, &anAlign);
- printf("copy ivar: %s %d %d\n",
ivar_getName(ivarList[i]), aSize, log2(aSize));
- class_addIvar(toClass, ivar_getName(ivarList[i]),
aSize, log2(aSize),
- ivar_getTypeEncoding(ivarList[i]));
+ printf("copy ivar from %s to %s: %s %s %ld %ld\n",
class_getName(fromClass), class_getName(toClass),
+ ivar_getName(ivarList[i]), ivar_getTypeEncoding(ivarList[i]),
aSize, anAlign);
+ class_addIvar(toClass, ivar_getName(ivarList[i]),
aSize, anAlign, ivar_getTypeEncoding(ivarList[i]));
}
free(ivarList);
}
Modified: trunk/swarm/src/defobj/swarm-objc-apple2.h
===================================================================
--- trunk/swarm/src/defobj/swarm-objc-apple2.h 2011-03-04 18:03:23 UTC (rev
7942)
+++ trunk/swarm/src/defobj/swarm-objc-apple2.h 2012-03-14 22:19:17 UTC (rev
7943)
@@ -69,6 +69,10 @@
#define swarm_method_getName(method) method_getName(method)
#define swarm_method_getTypeEncoding(method) method_getTypeEncoding(method)
+#define swarm_protocol_getName(p) protocol_getName((Protocol *)p)
+#define swarm_protocol_copyProtocolList(p, outCount) (ObjcProtocol
**)protocol_copyProtocolList((Protocol *)p, outCount)
+
+
// SWARM_TODO - selector type info
#define swarm_sel_getName(sel) sel_getName(sel)
#define swarm_sel_getTypedUid(str, types) sel_getUid(str)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [swarm-cvs] [7943] use NSInvocation instead of avcall on OpenStep, fix 64-bit on Mac OSX,
Scott Christley <=