1 #ifndef PGIMPORT_INTERNAL_H
2 #define PGIMPORT_INTERNAL_H
4 #include "include/pgimport.h"
7 #define encapsulate_api(ptr, module) \
8 PyCapsule_New(ptr, PG_CAPSULE_NAME(module), NULL)
9 #else /* ~PG_HAVE_CAPSULE */
10 #define encapsulate_api(ptr, module) PyCObject_FromVoidPtr(ptr, NULL)
11 #endif /* ~PG_HAVE_CAPSULE */
13 #endif /* PGIMPORT_INTERNAL_H */