From 6eba6c092b2507ece525f61b15f6b57dd018a269 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Fri, 11 Dec 2020 10:07:29 +0100 Subject: [PATCH] Suppress -Wunused-function about _import_array when compiling tkagg.cpp. Per https://numpy.org/doc/1.17/reference/c-api.array.html#c.NO_IMPORT_ARRAY Other extension modules in Matplotlib already use the same mechanism. --- src/_tkagg.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/_tkagg.cpp b/src/_tkagg.cpp index d74800d5241d..3e5793f03ce8 100644 --- a/src/_tkagg.cpp +++ b/src/_tkagg.cpp @@ -33,6 +33,9 @@ #define dlsym GetProcAddress #else #include +// Suppress -Wunused-function on POSIX, but not on Windows where that would +// lead to PY_ARRAY_UNIQUE_SYMBOL being an unresolved external. +#define NO_IMPORT_ARRAY #endif // Include our own excerpts from the Tcl / Tk headers