suppress "no such C type" warnings from cocoa for "?" and private apple types

db4
Joe Groff 2009-08-31 18:10:35 -05:00
parent f6c6593579
commit 3ea364bc80
1 changed files with 8 additions and 4 deletions

View File

@ -155,12 +155,16 @@ objc>alien-types get [ swap ] assoc-map
} case
assoc-union alien>objc-types set-global
: internal-cocoa-type? ( c-type -- ? )
[ "?" = ] [ first CHAR: _ = ] bi or ;
: warn-c-type ( c-type -- )
dup internal-cocoa-type?
[ drop ] [ "Warning: no such C type: " write print ] if ;
: objc-struct-type ( i string -- ctype )
[ CHAR: = ] 2keep index-from swap subseq
dup c-types get key? [
"Warning: no such C type: " write dup print
drop "void*"
] unless ;
dup c-types get key? [ warn-c-type "void*" ] unless ;
ERROR: no-objc-type name ;