]> gitweb.factorcode.org Git - factor.git/commitdiff
if any typedef in the chain has a pointer-c-type, use it
authorJoe Groff <arcata@gmail.com>
Tue, 23 Feb 2010 16:09:33 +0000 (08:09 -0800)
committerJoe Groff <arcata@gmail.com>
Tue, 23 Feb 2010 16:09:33 +0000 (08:09 -0800)
basis/alien/c-types/c-types-tests.factor
basis/alien/c-types/c-types.factor

index ad53dc487bd9c380cc361d986da4ef42890da4a3..10a7b50ebb965eb1cd7715cab447217898c3817e 100644 (file)
@@ -44,6 +44,14 @@ TYPEDEF: char MyFunkyChar
 [ f ] [ pointer: char c-type pointer: MyFunkyChar c-type = ] unit-test
 [ { char* ascii } ] [ pointer: MyFunkyChar c-type ] unit-test
 
+TYPEDEF: MyFunkyChar MyFunkyTypedef
+
+[ { char* ascii } ] [ pointer: MyFunkyTypedef c-type ] unit-test
+
+TYPEDEF: MyFunkyChar* MyFunkyString
+
+[ { char* ascii } ] [ MyFunkyString c-type ] unit-test
+
 TYPEDEF: char* MyString
 
 [ t ] [ char* c-type MyString          c-type = ] unit-test
index 316377dc27f687082ad69e39e37138d9e4bd01e6..3255d16d80ba7719d1ba847fb3d0df64941e245f 100644 (file)
@@ -301,7 +301,7 @@ CONSTANT: primitive-types
 : special-pointer-type ( type -- special-type )
     dup c-type-word? [
         dup "pointer-c-type" word-prop
-        [ ] [ resolve-pointer-typedef "pointer-c-type" word-prop ] ?if
+        [ ] [ "c-type" word-prop special-pointer-type ] ?if
     ] [ drop f ] if ;
 
 : primitive-pointer-type? ( type -- ? )