ExternalLibraryFunction.st
changeset 13782 1994fe87f21e
parent 13412 9a5f99d66cd9
child 14037 38519c7f45fa
--- a/ExternalLibraryFunction.st	Fri Oct 07 18:39:30 2011 +0200
+++ b/ExternalLibraryFunction.st	Fri Oct 07 20:01:43 2011 +0200
@@ -539,38 +539,41 @@
     |handle moduleNameUsed functionName|
 
     name isNumber ifTrue:[
-	self isCPPFunction ifTrue:[
-	    "/ no need to load a dll.
-	    ^ self
-	]
+        self isCPPFunction ifTrue:[
+            "/ no need to load a dll.
+            ^ self
+        ]
     ].
 
+    "/ in some other smalltalks, there is no moduleName in the ffi-spec;
+    "/ instead, the class provides the libraryName...
     (moduleNameUsed := moduleName) isNil ifTrue:[
-	owningClass isNil ifTrue:[
-	    self error:'Missing moduleName'.
-	].
-	moduleNameUsed := owningClass theNonMetaclass libraryName asSymbol.
+        owningClass isNil ifTrue:[
+            self error:'Missing moduleName'.
+        ].
+        moduleNameUsed := owningClass theNonMetaclass libraryName asSymbol.
     ].
     moduleHandle isNil ifTrue:[
-	handle := self loadLibrary:moduleNameUsed.
-	handle isNil ifTrue:[
-	    self error:('Cannot load module: "%1"' bindWith: moduleNameUsed).
-	].
-	moduleHandle := handle.
+        handle := self loadLibrary:moduleNameUsed.
+        handle isNil ifTrue:[
+            self error:('Cannot load module: "%1"' bindWith: moduleNameUsed).
+        ].
+        moduleHandle := handle.
     ].
     name isNumber ifFalse:[
-	functionName := name.
-	(moduleHandle getFunctionAddress:functionName into:self) isNil ifTrue:[
-	    functionName := ('_', functionName) asSymbol.
+        functionName := name.
+        (moduleHandle getFunctionAddress:functionName into:self) isNil ifTrue:[
+            functionName := ('_', functionName) asSymbol.
 
-	    (moduleHandle getFunctionAddress:functionName into:self) isNil ifTrue:[
-		moduleHandle := nil.
-		self error:'Missing function: ', name, ' in module: ', moduleNameUsed.
-	    ].
-	].
+            (moduleHandle getFunctionAddress:functionName into:self) isNil ifTrue:[
+                moduleHandle := nil.
+                self error:'Missing function: ', name, ' in module: ', moduleNameUsed.
+            ].
+        ].
     ].
 
     "Modified: / 01-08-2006 / 16:24:14 / cg"
+    "Modified (comment): / 07-10-2011 / 16:43:11 / cg"
 !
 
 loadLibrary:dllName
@@ -1500,11 +1503,11 @@
 !ExternalLibraryFunction class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalLibraryFunction.st,v 1.83 2011-06-28 12:07:39 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalLibraryFunction.st,v 1.84 2011-10-07 18:01:43 cg Exp $'
 !
 
 version_SVN
-    ^ ' Id: ExternalLibraryFunction.st 10643 2011-06-08 21:53:07Z vranyj1  '
+    ^ '§ Id: ExternalLibraryFunction.st 10643 2011-06-08 21:53:07Z vranyj1  §'
 ! !
 
 ExternalLibraryFunction initialize!