From: Mark Wooding Date: Sun, 20 Oct 2019 17:18:05 +0000 (+0100) Subject: catacomb-python.h: Add a macro to declare module init functions. X-Git-Url: https://git.distorted.org.uk/~mdw/pyke/commitdiff_plain/a21408714cc1139c840533e404ba9d8a80e4d7f9 catacomb-python.h: Add a macro to declare module init functions. --- diff --git a/catacomb-python.h b/catacomb-python.h index 85adf7d..87bf369 100644 --- a/catacomb-python.h +++ b/catacomb-python.h @@ -219,12 +219,11 @@ extern PyObject *modname; #define DOMODINSERT(m) m##_pyinsert(mod); #define INIT_MODULES do { MODULES(DOMODINIT) } while (0) #define INSERT_MODULES do { MODULES(DOMODINSERT) } while (0) - -#define DO(m) \ +#define DECLARE_MODINIT(m) \ extern void m##_pyinit(void); \ extern void m##_pyinsert(PyObject *); -MODULES(DO) -#undef DO + +MODULES(DECLARE_MODINIT) #define FREEOBJ(obj) \ (((PyObject *)(obj))->ob_type->tp_free((PyObject *)(obj)))