From: Pablo Galindo Date: Mon, 16 Nov 2020 23:59:55 +0000 (+0000) Subject: Add GCC pragmas to silence compiler warning about ffi_prep_closure (GH-23327) X-Git-Tag: v3.10.0a3~187 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cce3f0b0c88eba98bc11abe703a444bee7880ff8;p=thirdparty%2FPython%2Fcpython.git Add GCC pragmas to silence compiler warning about ffi_prep_closure (GH-23327) --- diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c index 3686287e45ac..654cb93dcf77 100644 --- a/Modules/_ctypes/callbacks.c +++ b/Modules/_ctypes/callbacks.c @@ -427,15 +427,22 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable, PyErr_Format(PyExc_NotImplementedError, "ffi_prep_closure_loc() is missing"); goto error; #else -#ifdef MACOSX +#if defined(__clang__) || defined(MACOSX) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif +#if defined(__GNUC__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p); -#ifdef MACOSX +#if defined(__clang__) || defined(MACOSX) #pragma clang diagnostic pop #endif +#if defined(__GNUC__) + #pragma GCC diagnostic pop +#endif #endif }