mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-25 04:40:19 +02:00
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.)
This commit is contained in:
parent
cb5b7677a2
commit
6703caf726
2 changed files with 11 additions and 18 deletions
|
@ -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
|
* SCM_WTA_DISPATCH
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#ifndef SCM_ERROR_H
|
#ifndef SCM_ERROR_H
|
||||||
#define 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
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
@ -34,6 +34,16 @@ SCM_API SCM scm_arg_type_key;
|
||||||
SCM_API SCM scm_memory_alloc_key;
|
SCM_API SCM scm_memory_alloc_key;
|
||||||
SCM_API SCM scm_misc_error_key;
|
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_API void scm_error (SCM key, const char *subr, const char *message,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue