Prefix the FIELD_DESCRIPTOR macro

This commit is contained in:
Ivan Smirnov 2016-06-26 16:18:46 +01:00
parent 5e71e17bdf
commit 95e9b12322

View File

@ -267,7 +267,7 @@ private:
static inline char* format_() { static char s[4096]; return s; } static inline char* format_() { static char s[4096]; return s; }
}; };
#define FIELD_DESCRIPTOR(Type, Field) \ #define PB11_IMPL_FIELD_DESCRIPTOR(Type, Field) \
::pybind11::detail::field_descriptor { \ ::pybind11::detail::field_descriptor { \
#Field, offsetof(Type, Field), \ #Field, offsetof(Type, Field), \
::pybind11::detail::npy_format_descriptor<decltype(static_cast<Type*>(0)->Field)>::descr() \ ::pybind11::detail::npy_format_descriptor<decltype(static_cast<Type*>(0)->Field)>::descr() \
@ -298,7 +298,7 @@ private:
#define PYBIND11_DTYPE(Type, ...) \ #define PYBIND11_DTYPE(Type, ...) \
::pybind11::detail::npy_format_descriptor<Type>::register_dtype \ ::pybind11::detail::npy_format_descriptor<Type>::register_dtype \
({PB11_IMPL_MAP_LIST(FIELD_DESCRIPTOR, Type, __VA_ARGS__)}) ({PB11_IMPL_MAP_LIST(PB11_IMPL_FIELD_DESCRIPTOR, Type, __VA_ARGS__)})
template <class T> template <class T>
using array_iterator = typename std::add_pointer<T>::type; using array_iterator = typename std::add_pointer<T>::type;