*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Tue, 18 Jun 2019 12:49:34 +0200
changeset 24335 0b12e9a57aa2
parent 24333 e6d6a165972d
child 24336 50aac49521fe
*** empty log message ***
ExternalLibraryFunction.st
--- a/ExternalLibraryFunction.st	Tue Jun 11 10:48:05 2019 +0200
+++ b/ExternalLibraryFunction.st	Tue Jun 18 12:49:34 2019 +0200
@@ -40,7 +40,7 @@
 
 #ifdef HAVE_FFI
 
-# include <ffi.h>
+# include <ffi/ffi.h>
 # define MAX_ARGS    128
 
 # ifdef USE_STANDARD_FFI
@@ -553,7 +553,7 @@
      Use this, to adjust all thoseafter a change in the type mapping"
 
     self allSubInstancesDo:[:eachCall |
-        eachCall adjustTypes
+	eachCall adjustTypes
     ].
 
     "Created: / 02-05-2019 / 14:31:37 / Stefan Reise"
@@ -561,16 +561,16 @@
 
 ffiTypeSymbolForType:aType
     "map aType to one of the ffi-supported ones:
-        sint8, sint16, sint32, sint64
-        uint8, uint16, uint32, uint64
-        long ulong int uint
-        bool float double void pointer handle
+	sint8, sint16, sint32, sint64
+	uint8, uint16, uint32, uint64
+	long ulong int uint
+	bool float double void pointer handle
     "
 
     |mappedType|
 
     TypeMap notNil ifTrue:[
-        (mappedType := TypeMap at:aType ifAbsent:nil) notNil ifTrue:[^ mappedType].
+	(mappedType := TypeMap at:aType ifAbsent:nil) notNil ifTrue:[^ mappedType].
     ].
 
     aType == #sint8           ifTrue:[^ aType ].
@@ -644,7 +644,7 @@
     aType == #BOOL            ifTrue:[^ #int ].
     aType == #BOOLEAN         ifTrue:[^ #uint8 ].
     aType == #BYTE            ifTrue:[^ #uint8 ].
-    "/ actually described as long (i.e. signed) in MS-docmentation, 
+    "/ actually described as long (i.e. signed) in MS-docmentation,
     "/ but our code seems to depend on it being a uint32. See OLE code HRESULT succeeded:hresult
     (aType == #hresult or:[aType == #HRESULT])   ifTrue:[^ #uint32 ].
     (aType == #lparam or:[aType == #LPARAM])   ifTrue:[^ #pointer ].
@@ -657,22 +657,22 @@
     aType == #SIZE_T          ifTrue:[^ ExternalBytes sizeofPointer == 8 ifTrue:[#uint64] ifFalse:[#uint32]].
 
     (aType isString or:[aType isSymbol]) ifFalse:[
-        aType isArray ifTrue:[
-            ^ aType collect:[:each | self ffiTypeSymbolForType:each]
-        ].
-
-        CType isNil ifTrue:[
-            self error:'unknown type'.
-        ].
-        "/ assume it is a ctype
-        ^ aType typeSymbol.
+	aType isArray ifTrue:[
+	    ^ aType collect:[:each | self ffiTypeSymbolForType:each]
+	].
+
+	CType isNil ifTrue:[
+	    self error:'unknown type'.
+	].
+	"/ assume it is a ctype
+	^ aType typeSymbol.
     ].
 
     (aType endsWith:'*') ifTrue:[
-        ^ #pointer.
+	^ #pointer.
     ].
     (aType endsWith:'Pointer') ifTrue:[
-        ^ #pointer.
+	^ #pointer.
     ].
     ^ aType