ExternalLibraryFunction.st
branchjv
changeset 19863 513bd7237fe7
parent 19559 d35a89d5c0ec
parent 19860 324edacff5cc
child 19948 be658f466bca
--- a/ExternalLibraryFunction.st	Sun May 15 08:38:43 2016 +0100
+++ b/ExternalLibraryFunction.st	Tue May 17 10:05:14 2016 +0100
@@ -100,10 +100,10 @@
     instances of me are used to interface to external library functions (as found in a dll/shared object).
 
     Inside a method, when a special external-call pragma such as:
-        <api: bool MessageBeep(uint)>
+	<api: bool MessageBeep(uint)>
 
     is encountered by the parser, the compiler generates a call via
-        <correspondingExternalLibraryFunctionObject> invokeWithArguments: argumentArray.
+	<correspondingExternalLibraryFunctionObject> invokeWithArguments: argumentArray.
     and the correspondingExternalLibraryFunctionObject is kept in the literal array.
 
     In the invoke method, the library is checked to be loaded (and loaded if not already),
@@ -111,22 +111,22 @@
     and finally, the return value is converted back from C to a smalltalk object.
 
     The parser supports the call-syntax of various other smalltalk dialects:
-        Squeak / ST-X:
-            <cdecl:   [async] [virtual|nonVirtual][const] returnType functionNameStringOrIndex ( argType1..argTypeN ) module: moduleName >
-            <apicall: [async] [virtual|nonVirtual][const] returnType functionNameStringOrIndex ( argType1..argTypeN ) module: moduleName >
+	Squeak / ST-X:
+	    <cdecl:   [async] [virtual|nonVirtual][const] returnType functionNameStringOrIndex ( argType1..argTypeN ) module: moduleName >
+	    <apicall: [async] [virtual|nonVirtual][const] returnType functionNameStringOrIndex ( argType1..argTypeN ) module: moduleName >
 
-        Dolphin:
-            <stdcall: [virtual|nonVirtual][const] returnType functionNameStringOrIndex argType1..argTypeN>
-            <cdecl:   [virtual|nonVirtual][const] returnType functionNameStringOrIndex argType1..argTypeN>
+	Dolphin:
+	    <stdcall: [virtual|nonVirtual][const] returnType functionNameStringOrIndex argType1..argTypeN>
+	    <cdecl:   [virtual|nonVirtual][const] returnType functionNameStringOrIndex argType1..argTypeN>
 
-        ST/V:
-            <api: functionName argType1 .. argTypeN returnType>
-            <ccall: functionName argType1 .. argTypeN returnType>
-            <ole: vFunctionIndex argType1 .. argTypeN returnType>
+	ST/V:
+	    <api: functionName argType1 .. argTypeN returnType>
+	    <ccall: functionName argType1 .. argTypeN returnType>
+	    <ole: vFunctionIndex argType1 .. argTypeN returnType>
 
-        VisualWorks:
-            <c: ...>
-            <c: #define NAME value>
+	VisualWorks:
+	    <c: ...>
+	    <c: #define NAME value>
 "
 !
 
@@ -219,19 +219,19 @@
 dllMapping
     "allows for dll's to be replaced,
      for example, if you want to use the mozilla sqlite dll
-        C:\Program Files\Mozilla Firefox\mozsqlite3.dll
+	C:\Program Files\Mozilla Firefox\mozsqlite3.dll
      for the sqlite3, execute:
-        ExternalLibraryFunction
-            dllMapping at:'sqlite3'
-            put: 'C:\Program Files\Mozilla Firefox\mozsqlite3.dll'
+	ExternalLibraryFunction
+	    dllMapping at:'sqlite3'
+	    put: 'C:\Program Files\Mozilla Firefox\mozsqlite3.dll'
      for mingw:
-        ExternalLibraryFunction
-            dllMapping at:'sqlite3'
-            put:'C:\mingw64\opt\bin\libsqlite3-0.dll'
+	ExternalLibraryFunction
+	    dllMapping at:'sqlite3'
+	    put:'C:\mingw64\opt\bin\libsqlite3-0.dll'
     "
 
     DllMapping isNil ifTrue:[
-        DllMapping := Dictionary new.
+	DllMapping := Dictionary new.
     ].
     ^ DllMapping
 
@@ -1770,7 +1770,7 @@
 	    printf("async call 0x%"_lx_"\n", (INT)codeAddress);
 	}
 # endif
-# ifdef WIN32
+# ifdef __win32__
 	__STX_C_CALL4( "ffi_call", ffi_call, &__cif, codeAddress, __returnValuePointer, __argValuePointersIncludingThis);
 # else
 	__BEGIN_INTERRUPTABLE__