]> gitweb.factorcode.org Git - factor.git/commitdiff
system-info.macosx: simplify gestalt.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 2 Jun 2014 22:11:09 +0000 (15:11 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 2 Jun 2014 22:11:09 +0000 (15:11 -0700)
basis/system-info/macosx/macosx.factor

index 7803d2b793f940f51dc2eee7f56fc85bf24c58b9..9274d9e1ae86b8c0ecda6033392d660d41f748f6 100644 (file)
@@ -15,8 +15,7 @@ TYPEDEF: UInt32 OSType
 FUNCTION: OSErr Gestalt ( OSType selector, SInt32* response ) ;
 
 : gestalt ( selector -- response )
-    0 SInt32 <ref> [ Gestalt ] keep
-    swap [ throw ] unless-zero le> ;
+    { SInt32 } [ Gestalt 0 assert= ] with-out-parameters ;
 
 : system-version ( -- n ) "sysv" be> gestalt ;
 : system-version-major ( -- n ) "sys1" be> gestalt ;