From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 1 Dec 2020 15:07:50 +0000 (-0800) Subject: Add GCC pragmas to silence compiler warning about ffi_prep_closure (GH-23327) (GH... X-Git-Tag: v3.9.1~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ae48dd4db53f64f053a6ed6571d083c332d06ff7;p=thirdparty%2FPython%2Fcpython.git Add GCC pragmas to silence compiler warning about ffi_prep_closure (GH-23327) (GH-23590) (cherry picked from commit cce3f0b0c88eba98bc11abe703a444bee7880ff8) Co-authored-by: Pablo Galindo Co-authored-by: Pablo Galindo --- diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c index 39cace58294d..19c77f4f57ef 100644 --- a/Modules/_ctypes/callbacks.c +++ b/Modules/_ctypes/callbacks.c @@ -426,15 +426,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 }