]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/alien/parser/parser.factor
Merge alien/parser/parser.factor
[factor.git] / basis / alien / parser / parser.factor
index d073a4caac2b9f863f394c7f6db4e777e206b098..8d850c47eea8500b6542452ae16fb063c0770cb4 100644 (file)
@@ -66,16 +66,16 @@ IN: alien.parser
         2 group [ first2 normalize-c-arg 2array ] map
         unzip [ "," ?tail drop ] map
     ]
-    [ dup "void" = [ drop { } ] [ 1array ] if ]
+    [ [ { } ] [ name>> 1array ] if-void ]
     bi* <effect> ;
 
 : function-quot ( return library function types -- quot )
     '[ _ _ _ _ alien-invoke ] ;
 
 :: make-function ( return library function parameters -- word quot effect )
-    return function normalize-c-arg :> ( return-c-type function )
+    return function normalize-c-arg :> ( return function )
     function create-in dup reset-generic
-    return-c-type library function
+    return library function
     parameters return parse-arglist [ function-quot ] dip ;
 
 : parse-arg-tokens ( -- tokens )
@@ -88,10 +88,7 @@ IN: alien.parser
     make-function define-declared ;
 
 : callback-quot ( return types abi -- quot )
-    [ [ ] 3curry dip alien-callback ] 3curry ;
-
-: library-abi ( lib -- abi )
-    library [ abi>> ] [ "cdecl" ] if* ;
+    '[ [ _ _ _ ] dip alien-callback ] ;
 
 :: make-callback-type ( lib return type-name parameters -- word quot effect )
     return type-name normalize-c-arg :> ( return-c-type type-name )
@@ -115,4 +112,3 @@ PREDICATE: alien-function-word < word
 
 PREDICATE: alien-callback-type-word < typedef-word
     "callback-effect" word-prop ;
-