aboutsummaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-09-13 22:56:49 +0000
committerdos-reis <gdr@axiomatics.org>2008-09-13 22:56:49 +0000
commit6feba77e44809a9eb39f9cc54bfa7c01f42eb098 (patch)
tree3ea8ae6d8b53684344a95beb77e7f73283f1b637 /src/boot
parent65e866db45bf4713c62af9d727955d40c1f39b53 (diff)
downloadopen-axiom-6feba77e44809a9eb39f9cc54bfa7c01f42eb098.tar.gz
* lisp/core.lisp.in (|$NativeTypeTable|): Don' include `pointer'
and `buffer'. * lisp/Makefile.in (pointer_type): Remove. (edit): Tidy. * boot/ast.boot (nativeType): Tidy. Handle `pointer' and `buffer' here. * boot/translator.boot (genImportDeclaration): Tidy.
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,