From 081150b477dfbd5dce9d3a7faaa0d12fce9380e9 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 21 Jun 2001 23:40:04 +0000 Subject: [PATCH] Quick Borland fix [SVN r10391] --- include/boost/python/detail/types.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/boost/python/detail/types.hpp b/include/boost/python/detail/types.hpp index ee33ce04..5f0c8f97 100644 --- a/include/boost/python/detail/types.hpp +++ b/include/boost/python/detail/types.hpp @@ -375,8 +375,12 @@ PyObject* reprable::instance_repr(PyObject* obj) const // This macro gets the length of an array as a compile-time constant, and will // fail to compile if the parameter is a pointer. +#ifdef __BORLANDC__ // smart implementation doesn't work for borland; maybe someone knows a workaround? +# define PY_ARRAY_LENGTH(a) (sizeof(a) / sizeof((a)[0])) +#else # define PY_ARRAY_LENGTH(a) \ (sizeof(::boost::python::detail::countof_validate(a, &(a))) ? sizeof(a) / sizeof((a)[0]) : 0) +#endif template inline void countof_validate(T* const, T* const*);