From 79a0410b64d6aa323dec45aa44d24cbfed764222 Mon Sep 17 00:00:00 2001 From: Marcel Loose <loose@astron.nl> Date: Mon, 21 May 2012 12:06:21 +0000 Subject: [PATCH] Task #3249: Re-added aux.h as per previous commit --- CEP/PyBDSM/src/c++/aux.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 CEP/PyBDSM/src/c++/aux.h diff --git a/CEP/PyBDSM/src/c++/aux.h b/CEP/PyBDSM/src/c++/aux.h new file mode 100644 index 00000000000..bbe83206dd6 --- /dev/null +++ b/CEP/PyBDSM/src/c++/aux.h @@ -0,0 +1,32 @@ +#ifndef _AUX_H_INCLUDED +#define _AUX_H_INCLUDED + +/*! + \file aux.h + + \ingroup pybdsm + + \brief Miscellaneous usefull routines +*/ + +#include <boost/version.hpp> +#include <boost/python.hpp> +#include <boost/python/detail/api_placeholder.hpp> + +#if BOOST_VERSION > 103200 +#define ADD_PROPERTY1(name, get, doc) .add_property(name, get, doc) +#define ADD_PROPERTY2(name, get, set, doc) .add_property(name, get, set, doc) +#else +#define ADD_PROPERTY1(name, get, doc) .add_property(name, get) +#define ADD_PROPERTY2(name, get, set, doc) .add_property(name, get, set) +#endif + +inline void py_assert(bool cond, PyObject *exc, const char *msg) +{ + if(!cond) { + PyErr_SetString(exc, msg); + throw boost::python::error_already_set(); + } +} + +#endif // _AUX_H_INCLUDED -- GitLab