aboutsummaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/ast.boot18
-rw-r--r--src/boot/translator.boot5
2 files changed, 19 insertions, 4 deletions
diff --git a/src/boot/ast.boot b/src/boot/ast.boot
index b0d5d769..15cd2ab8 100644
--- a/src/boot/ast.boot
+++ b/src/boot/ast.boot
@@ -1218,12 +1218,28 @@ bootSymbol: %Symbol -> %Symbol
bootSymbol s ==
INTERN SYMBOL_-NAME s
+
+unknownNativeTypeError t ==
+ fatalError CONCAT('"unsupported native type: ", SYMBOL_-NAME t)
+
+
nativeType t ==
null t => t
+ -- for the time being, approximate `data buffer' by `pointer to data'
+ t = "buffer" or t = "pointer" =>
+ %hasFeature KEYWORD::GCL => "fixnum"
+ %hasFeature KEYWORD::ECL => KEYWORD::POINTER_-VOID
+ %hasFeature KEYWORD::SBCL => ["*",true]
+ %hasFeature KEYWORD::CLISP => bfColonColon("FFI","C-POINTER")
+ unknownNativeTypeError t
t' := rest ASSOC(coreSymbol t,$NativeTypeTable) =>
+ t' :=
+ %hasFeature KEYWORD::SBCL => bfColonColon("SB-ALIEN", t')
+ %hasFeature KEYWORD::CLISP => bfColonColon("FFI",t')
+ t'
-- ??? decree we have not discovered Unicode yet.
t = "string" and %hasFeature KEYWORD::SBCL =>
[t',KEYWORD::EXTERNAL_-FORMAT,KEYWORD::ASCII,
KEYWORD::ELEMENT_-TYPE, "BASE-CHAR"]
t'
- fatalError CONCAT('"unsupported native type: ", SYMBOL_-NAME t)
+ unknownNativeTypeError t
diff --git a/src/boot/translator.boot b/src/boot/translator.boot
index c972af6c..5358d91b 100644
--- a/src/boot/translator.boot
+++ b/src/boot/translator.boot
@@ -426,9 +426,8 @@ genImportDeclaration(op, sig) ==
n := INTERN strconc(SYMBOL_-NAME op, '"%clisp-hack")
[bfColonColon("FFI","DEF-CALL-OUT"),n,
[KEYWORD::NAME,SYMBOL_-NAME op'],
- [KEYWORD::ARGUMENTS,:[[a,
- bfColonColon("FFI", nativeType x)] for x in s for a in args]],
- [KEYWORD::RETURN_-TYPE,bfColonColon("FFI",nativeType t)],
+ [KEYWORD::ARGUMENTS,:[[a, nativeType x] for x in s for a in args]],
+ [KEYWORD::RETURN_-TYPE, nativeType t],
[KEYWORD::LANGUAGE,KEYWORD::STDC]]
forwardingFun :=
["DEFUN",op,args,