From 39b7773d3203147176c85802fb0e8af9096e6f3f Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 26 Apr 2024 18:26:01 +0200 Subject: [PATCH] Switch to PyMODINIT_FUNC annotation Instead of doing some 'extern ...' declaration magic to force proper PyInit_libvirtmod*() symbol exposure in resulting .so we can use what Python already offers - PyMODINIT_FUNC macro and call it a day. Signed-off-by: Michal Privoznik --- libvirt-lxc-override.c | 8 +------- libvirt-override.c | 8 +------- libvirt-qemu-override.c | 8 +------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/libvirt-lxc-override.c b/libvirt-lxc-override.c index 109b823..3dd0a89 100644 --- a/libvirt-lxc-override.c +++ b/libvirt-lxc-override.c @@ -21,12 +21,6 @@ #include "libvirt-utils.h" #include "libvirt-lxc.h" -#ifndef __CYGWIN__ -extern PyObject *PyInit_libvirtmod_lxc(void); -#else -extern PyObject *PyInit_cygvirtmod_lxc(void); -#endif - #if 0 # define DEBUG_ERROR 1 #endif @@ -115,7 +109,7 @@ static struct PyModuleDef moduledef = { NULL }; -PyObject * +PyMODINIT_FUNC #ifndef __CYGWIN__ PyInit_libvirtmod_lxc #else diff --git a/libvirt-override.c b/libvirt-override.c index 8838586..419e7ba 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -29,12 +29,6 @@ #include "libvirt.h" #include "libvirt-utils.h" -#ifndef __CYGWIN__ -extern PyObject *PyInit_libvirtmod(void); -#else -extern PyObject *PyInit_cygvirtmod(void); -#endif - #if 0 # define DEBUG_ERROR 1 #endif @@ -11227,7 +11221,7 @@ static struct PyModuleDef moduledef = { NULL }; -PyObject * +PyMODINIT_FUNC #ifndef __CYGWIN__ PyInit_libvirtmod #else diff --git a/libvirt-qemu-override.c b/libvirt-qemu-override.c index 92ba7da..d741990 100644 --- a/libvirt-qemu-override.c +++ b/libvirt-qemu-override.c @@ -25,12 +25,6 @@ # include #endif -#ifndef __CYGWIN__ -extern PyObject *PyInit_libvirtmod_qemu(void); -#else -extern PyObject *PyInit_cygvirtmod_qemu(void); -#endif - #if 0 # define DEBUG_ERROR 1 #endif @@ -478,7 +472,7 @@ static struct PyModuleDef moduledef = { NULL }; -PyObject * +PyMODINIT_FUNC #ifndef __CYGWIN__ PyInit_libvirtmod_qemu #else