ext/pycall/pycall_internal.h in pycall-1.4.1 vs ext/pycall/pycall_internal.h in pycall-1.4.2

- old
+ new

@@ -32,10 +32,26 @@ # define NUM2PTR(x) ((void*)(NUM2ULL(x))) #else # error ---->> ruby requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<---- #endif +#ifndef RUBY_ASSERT +# define RUBY_ASSERT(expr) assert(expr) +#endif + +#ifndef RBIMPL_ATTR_NONNULL +# define RBIMPL_ATTR_NONNULL(list) /* void */ +#endif + +#ifndef RBIMPL_NONNULL_ARG +# define RBIMPL_NONNULL_ARG(arg) RUBY_ASSERT(arg) +#endif + +#ifndef RBIMPL_ATTR_FORMAT +# define RBIMPL_ATTR_FORMAT(x, y, z) /* void */ +#endif + #ifndef RB_INTEGER_TYPE_P # define RB_INTEGER_TYPE_P(obj) pycall_integer_type_p(obj) static inline int pycall_integer_type_p(VALUE obj) { @@ -566,10 +582,11 @@ PyObject * (* PyObject_Dir)(PyObject *); PyObject * (* PyObject_GenericGetAttr)(PyObject *, PyObject *); PyObject * (* PyObject_GetAttrString)(PyObject *, char const *); int (* PyObject_SetAttrString)(PyObject *, char const *, PyObject *); int (* PyObject_HasAttrString)(PyObject *, char const *); + int (* PyObject_DelAttrString)(PyObject *, char const *); PyObject * (* PyObject_GetItem)(PyObject *, PyObject *); int (* PyObject_SetItem)(PyObject *obj, PyObject *key, PyObject *value); int (* PyObject_DelItem)(PyObject *, PyObject *); PyObject * (* PyObject_GetIter)(PyObject *); PyObject * (* PyObject_Str)(PyObject *); @@ -690,10 +707,12 @@ PyObject *pycall_pytuple_from_ruby(VALUE); PyObject *pycall_pylist_from_ruby(VALUE); PyObject *pycall_pydict_from_ruby(VALUE); PyObject *pycall_pyslice_from_ruby(VALUE); +RBIMPL_ATTR_NONNULL((1)) +RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 1, 0) NORETURN(void pycall_pyerror_fetch_and_raise(char const *format, ...)); unsigned long pycall_default_tp_flags(void); PyObject *pycall_pystring_from_format(char const *format, ...); PyObject *pycall_pystring_from_formatv(char const *format, va_list vargs); @@ -712,10 +731,10 @@ void pycall_init_exceptions(VALUE handle); void pycall_init_gcguard(void); void pycall_init_ruby_wrapper(void); #define pycall_hash_salt_32 0xb592cd9b -extern long pycall_hash_salt; +extern intptr_t pycall_hash_salt; extern VALUE pycall_mPyCall; extern VALUE pycall_cPyPtr; extern VALUE pycall_eError; #define mPyCall pycall_mPyCall