]> gitweb.factorcode.org Git - factor.git/commitdiff
windows.com: typedef interface word to void* immediately so that self-referential...
authorJoe Groff <arcata@gmail.com>
Fri, 26 Feb 2010 00:39:30 +0000 (16:39 -0800)
committerJoe Groff <arcata@gmail.com>
Fri, 26 Feb 2010 00:39:30 +0000 (16:39 -0800)
basis/windows/com/com-tests.factor
basis/windows/com/syntax/syntax.factor

index f0b4eadb9f545cad974f32ea8a2a6112e1782404..fdc48adfbe5fc8fb2ea9fae2a9e5c8a0affa56ec 100644 (file)
@@ -16,6 +16,9 @@ COM-INTERFACE: IUnrelated IUnknown {b06ac3f4-30e4-406b-a7cd-c29cead4552c}
     int xPlus ( int y )
     int xMulAdd ( int mul, int add ) ;
 
+COM-INTERFACE: ISelfReferential IUnknown {d4f45bf8-f720-4701-a09d-e8e341981121}
+    ISelfReferential* selfReference ( ) ;
+
 { GUID: {216fb341-0eb2-44b1-8edb-60b76e353abc} } [ ISimple-iid ] unit-test
 { GUID: {9620ecec-8438-423b-bb14-86f835aa40dd} } [ IInherited-iid ] unit-test
 { GUID: {00000000-0000-0000-C000-000000000046} } [ IUnknown-iid ] unit-test
index 7e93a6e9f8e3c8b8beb8523e0da0b08de0844ec4..5230d9497e04f07fd51e4240e15693d843d891d8 100644 (file)
@@ -3,6 +3,7 @@ effects kernel windows.ole32 parser lexer splitting grouping
 sequences namespaces assocs quotations generalizations
 accessors words macros alien.syntax fry arrays layouts math
 classes.struct windows.kernel32 ;
+FROM: alien.parser.private => return-type-name ;
 IN: windows.com.syntax
 
 <PRIVATE
@@ -71,7 +72,7 @@ ERROR: no-com-interface interface ;
 : (stack-effect-from-return-and-parameters) ( return parameters -- stack-effect )
     swap
     [ [ second ] map ]
-    [ dup void? [ drop { } ] [ name>> 1array ] if ] bi*
+    [ dup void? [ drop { } ] [ return-type-name 1array ] if ] bi*
     <effect> ;
 
 : (define-word-for-function) ( function interface n -- )
@@ -83,17 +84,16 @@ ERROR: no-com-interface interface ;
 
 : define-words-for-com-interface ( definition -- )
     [ [ (iid-word) ] [ iid>> 1quotation ] bi (( -- iid )) define-declared ]
-    [ word>> void* swap typedef ]
     [
         dup family-tree-functions
         [ (define-word-for-function) ] with each-index
-    ]
-    tri ;
+    ] bi ;
 
 PRIVATE>
 
 SYNTAX: COM-INTERFACE:
     CREATE-C-TYPE
+    void* over typedef
     scan-object find-com-interface-definition
     scan string>guid
     parse-com-functions