summaryrefslogtreecommitdiff
path: root/libguile/smob.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2018-06-18 09:44:35 +0200
committerAndy Wingo <wingo@pobox.com>2018-06-18 09:44:35 +0200
commit8a6f46ee96e0946e539e3a33c95c3228b63e9fb3 (patch)
tree6df1b84f414e46add11e2329f89f15d26a647752 /libguile/smob.h
parentbe18b507735ccb6006dcd9a58cba7119b43b7d7c (diff)
downloadguile-8a6f46ee96e0946e539e3a33c95c3228b63e9fb3.tar.gz
More validate.h devolution
* libguile/validate.h: * libguile/alist.h (SCM_VALIDATE_ALISTCELL, SCM_VALIDATE_ALISTCELL_COPYSCM) * libguile/bytevectors.h (SCM_VALIDATE_BYTEVECTOR) * libguile/chars.h (SCM_VALIDATE_CHAR, SCM_VALIDATE_CHAR_COPY): * libguile/print.h (SCM_VALIDATE_OPORT_VALUE, SCM_VALIDATE_PRINTSTATE): * libguile/procs.h (SCM_VALIDATE_THUNK) * libguile/smob.h (SCM_VALIDATE_SMOB) * libguile/strings.h (SCM_VALIDATE_STRING): Devolve these macros from validate.h.
Diffstat (limited to 'libguile/smob.h')
-rw-r--r--libguile/smob.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/libguile/smob.h b/libguile/smob.h
index 561a6d124..e10db4fc6 100644
--- a/libguile/smob.h
+++ b/libguile/smob.h
@@ -3,8 +3,8 @@
#ifndef SCM_SMOB_H
#define SCM_SMOB_H
-/* Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2004, 2006, 2009,
- * 2010, 2011, 2012, 2015 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1996,1998-2001,2004,2006,2009-2012,2015,2018
+ * 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
@@ -25,6 +25,7 @@
#include "libguile/__scm.h"
+#include <libguile/error.h>
#include "libguile/print.h"
@@ -54,6 +55,12 @@ typedef struct scm_smob_descriptor
#define SCM_SMOB_DESCRIPTOR(x) (scm_smobs[SCM_SMOBNUM (x)])
#define SCM_SMOB_APPLICABLE_P(x) (SCM_SMOB_DESCRIPTOR (x).apply)
+#define SCM_VALIDATE_SMOB(pos, obj, type) \
+ do { \
+ SCM_ASSERT (SCM_SMOB_PREDICATE (scm_tc16_ ## type, obj), \
+ obj, pos, FUNC_NAME); \
+ } while (0)
+
/* Maximum number of SMOB types. */
#define SCM_I_MAX_SMOB_TYPE_COUNT 256