iokit: don't depend on debugger, reduces terrain demo size by a bit

Slava Pestov 2009-08-22 19:02:40 -05:00
parent 55a6fcd3c2
commit d336b079d4
1 changed files with 4 additions and 6 deletions

View File

@ -1,6 +1,6 @@
USING: alien.syntax alien.c-types core-foundation USING: alien.syntax alien.c-types core-foundation
core-foundation.bundles core-foundation.dictionaries system core-foundation.bundles core-foundation.dictionaries system
combinators kernel sequences debugger io accessors ; combinators kernel sequences io accessors ;
IN: iokit IN: iokit
<< <<
@ -136,11 +136,9 @@ FUNCTION: IOReturn IORegistryEntryCreateCFProperties ( io_registry_entry_t entry
FUNCTION: char* mach_error_string ( IOReturn error ) ; FUNCTION: char* mach_error_string ( IOReturn error ) ;
TUPLE: mach-error error-code ; TUPLE: mach-error error-code error-string ;
C: <mach-error> mach-error : <mach-error> ( code -- error )
dup mach_error_string \ mach-error boa ;
M: mach-error error.
"IOKit call failed: " print error-code>> mach_error_string print ;
: mach-error ( return -- ) : mach-error ( return -- )
dup KERN_SUCCESS = [ drop ] [ <mach-error> throw ] if ; dup KERN_SUCCESS = [ drop ] [ <mach-error> throw ] if ;