aboutsummaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorDave Beazley <dave-swig@dabeaz.com>2003-05-21 18:08:26 +0000
committerDave Beazley <dave-swig@dabeaz.com>2003-05-21 18:08:26 +0000
commit91048279ba42c304df5ae30370c64efd8a4b4bdf (patch)
tree05478d7af52b0fab007bf5744c0a020ced224bee /Lib
parentde0ac1f10bbd795c22096a7d491e54890f2aa9e0 (diff)
downloadswig-91048279ba42c304df5ae30370c64efd8a4b4bdf.tar.gz
Experimental contract work.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4807 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib')
-rw-r--r--Lib/python/pyrun.swg6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg
index 3e9aafdc2..6ce5f656e 100644
--- a/Lib/python/pyrun.swg
+++ b/Lib/python/pyrun.swg
@@ -405,6 +405,12 @@ SWIG_InstallConstants(PyObject *d, swig_const_info constants[]) {
#endif
+/* Contract support */
+
+#define SWIG_preassert(x) if (!(x)) { PyErr_SetString(PyExc_RuntimeError, "preassertion failure: " #x); goto fail; } else
+#define SWIG_postassert(x) if (!(x)) { PyErr_SetString(PyExc_RuntimeError, "postassertion failure: " #x); goto fail; } else
+#define SWIG_invarassert(x) if (!(x)) { PyErr_SetString(PyExc_RuntimeError, "invariant failure: " #x); goto fail; } else
+
#ifdef __cplusplus
}
#endif