From 5c637e05f3265e00ee2b52c496a478459665342c Mon Sep 17 00:00:00 2001 From: slava Date: Mon, 20 Feb 2006 03:51:55 +0000 Subject: [PATCH] Throw an error if a CF bundle could not be loaded --- TODO.FACTOR.txt | 1 - library/cocoa/core-foundation.factor | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 065e90d94a..b1d00d03f3 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,4 +1,3 @@ -- CFBundle error handling - out of memory from ffi calls - update amd64 for %unbox-struct and callbacks - clean up C stack frame assembly code to avoid moving spilled arguments diff --git a/library/cocoa/core-foundation.factor b/library/cocoa/core-foundation.factor index 3c36cc963c..4ff780c57e 100644 --- a/library/cocoa/core-foundation.factor +++ b/library/cocoa/core-foundation.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2006 Slava Pestov ! See http://factorcode.org/license.txt for BSD license. IN: cocoa -USING: alien arrays hashtables kernel namespaces ; +USING: alien arrays errors hashtables kernel namespaces +sequences ; TYPEDEF: int CFIndex @@ -47,4 +48,8 @@ FUNCTION: void CFRelease ( void* cf ) ; t f over CFBundleCreate swap CFRelease ; : load-framework ( name -- ) - CFBundleLoadExecutable drop ; + dup [ + CFBundleLoadExecutable drop + ] [ + "Cannot load bundled named " swap append throw + ] ?if ;