From 7803a7303d5a0899ff6d6983e5cdb07e4be13ca0 Mon Sep 17 00:00:00 2001 From: espen Date: Mon, 13 Feb 2006 20:03:29 +0000 Subject: [PATCH] Added convenient type GERROR-SIGNAL which will signal an error automatically when used as a return type instead of GERROR --- glib/gerror.lisp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/glib/gerror.lisp b/glib/gerror.lisp index a1554a6..79aff6b 100644 --- a/glib/gerror.lisp +++ b/glib/gerror.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gerror.lisp,v 1.2 2005/04/23 16:48:50 espen Exp $ +;; $Id: gerror.lisp,v 1.3 2006/02/13 20:03:29 espen Exp $ (in-package "GLIB") @@ -65,6 +65,15 @@ (error condition :code (gerror-code gerror) :message (gerror-message gerror)))) +(deftype gerror-signal () 'gerror) + +(defmethod from-alien-form (gerror (type (eql 'gerror-signal)) &rest args) + (declare (ignore type args)) + `(let ((gerror ,(from-alien-form gerror 'gerror))) + (when gerror + (signal-gerror gerror)))) + + ;;; Message logging (eval-when (:compile-toplevel :load-toplevel :execute) -- 2.11.0