From 6703caf7265602951ffcc932bddc64fc37769b19 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sun, 15 May 2011 13:34:07 +0200 Subject: [PATCH] SCM_ASSERT to error.h * libguile/error.h (SCM_ASSERT, SCM_ASSERT_TYPE): Move definition here. Remove SCM_RECKLESS case. * libguile/__scm.h: (From here.) --- libguile/__scm.h | 17 ----------------- libguile/error.h | 12 +++++++++++- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/libguile/__scm.h b/libguile/__scm.h index eb6d60372..3bb6b80d8 100644 --- a/libguile/__scm.h +++ b/libguile/__scm.h @@ -398,23 +398,6 @@ typedef long SCM_STACKITEM; -/** SCM_ASSERT - ** - **/ - - -#ifdef SCM_RECKLESS -#define SCM_ASSERT(_cond, _arg, _pos, _subr) -#define SCM_ASSERT_TYPE(_cond, _arg, _pos, _subr, _msg) -#else -#define SCM_ASSERT(_cond, _arg, _pos, _subr) \ - do { if (SCM_UNLIKELY (!(_cond))) \ - scm_wrong_type_arg (_subr, _pos, _arg); } while (0) -#define SCM_ASSERT_TYPE(_cond, _arg, _pos, _subr, _msg) \ - do { if (SCM_UNLIKELY (!(_cond))) \ - scm_wrong_type_arg_msg(_subr, _pos, _arg, _msg); } while (0) -#endif - /* * SCM_WTA_DISPATCH */ diff --git a/libguile/error.h b/libguile/error.h index 8cc68b752..1611fd529 100644 --- a/libguile/error.h +++ b/libguile/error.h @@ -3,7 +3,7 @@ #ifndef SCM_ERROR_H #define SCM_ERROR_H -/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2002, 2006, 2008 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2002, 2006, 2008, 2011 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -36,6 +36,16 @@ SCM_API SCM scm_misc_error_key; +#define SCM_ASSERT(_cond, _arg, _pos, _subr) \ + do { if (SCM_UNLIKELY (!(_cond))) \ + scm_wrong_type_arg (_subr, _pos, _arg); } while (0) +#define SCM_ASSERT_TYPE(_cond, _arg, _pos, _subr, _msg) \ + do { if (SCM_UNLIKELY (!(_cond))) \ + scm_wrong_type_arg_msg(_subr, _pos, _arg, _msg); } while (0) + + + + SCM_API void scm_error (SCM key, const char *subr, const char *message, SCM args, SCM rest) SCM_NORETURN; SCM_API SCM scm_error_scm (SCM key, SCM subr, SCM message, -- 2.20.1