From: espen Date: Mon, 13 Feb 2006 20:03:29 +0000 (+0000) Subject: Added convenient type GERROR-SIGNAL which will signal an error automatically when... X-Git-Tag: clg-0-92~55 X-Git-Url: https://git.distorted.org.uk/~mdw/clg/commitdiff_plain/7803a7303d5a0899ff6d6983e5cdb07e4be13ca0 Added convenient type GERROR-SIGNAL which will signal an error automatically when used as a return type instead of GERROR --- 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)