[nautilus-python/nautilus-python-gcc10: 1/2] Fix build with gcc 10




commit dd7b0fe8dfcdf57a530205ccfafe6cb1931f52ed
Author: Andreas Henriksson <andreas fatal se>
Date:   Mon May 11 14:57:45 2020 +0200

    Fix build with gcc 10
    
    Bug-Debian: https://bugs.debian.org/957578
    Forwarded: https://gitlab.gnome.org/GNOME/nautilus-python/-/merge_requests/7
    Last-Update: 2020-05-11

 src/nautilus-python.c | 13 +++++++++++++
 src/nautilus-python.h | 22 +++++++++++-----------
 2 files changed, 24 insertions(+), 11 deletions(-)
---
diff --git a/src/nautilus-python.c b/src/nautilus-python.c
index 843e3c6..510cdfb 100644
--- a/src/nautilus-python.c
+++ b/src/nautilus-python.c
@@ -22,6 +22,7 @@
 #endif
 
 #include <Python.h>
+#define NO_IMPORT_PYGOBJECT //To avoid a multiple definition, nautilus-python-object.c also includes and 
does the import.
 #include <pygobject.h>
 #include <gmodule.h>
 #include <gtk/gtk.h>
@@ -42,6 +43,18 @@ static gboolean nautilus_python_init_python(void);
 static GArray *all_types = NULL;
 
 
+PyTypeObject *_PyGtkWidget_Type;
+PyTypeObject *_PyNautilusColumn_Type;
+PyTypeObject *_PyNautilusColumnProvider_Type;
+PyTypeObject *_PyNautilusInfoProvider_Type;
+PyTypeObject *_PyNautilusLocationWidgetProvider_Type;
+PyTypeObject *_PyNautilusMenu_Type;
+PyTypeObject *_PyNautilusMenuItem_Type;
+PyTypeObject *_PyNautilusMenuProvider_Type;
+PyTypeObject *_PyNautilusPropertyPage_Type;
+PyTypeObject *_PyNautilusPropertyPageProvider_Type;
+PyTypeObject *_PyNautilusOperationHandle_Type;
+
 static inline gboolean 
 np_init_pygobject(void) {
     PyObject *gobject = pygobject_init (PYGOBJECT_MAJOR_VERSION, PYGOBJECT_MINOR_VERSION, 
PYGOBJECT_MICRO_VERSION);
diff --git a/src/nautilus-python.h b/src/nautilus-python.h
index 4c181f8..c940a06 100644
--- a/src/nautilus-python.h
+++ b/src/nautilus-python.h
@@ -43,37 +43,37 @@ extern NautilusPythonDebug nautilus_python_debug;
 #define debug_enter_args(x, y) { if (nautilus_python_debug & NAUTILUS_PYTHON_DEBUG_MISC) \
                                      g_printf("%s: entered " x "\n", __FUNCTION__, y); }
 
-PyTypeObject *_PyGtkWidget_Type;
+extern PyTypeObject *_PyGtkWidget_Type;
 #define PyGtkWidget_Type (*_PyGtkWidget_Type)
 
-PyTypeObject *_PyNautilusColumn_Type;
+extern PyTypeObject *_PyNautilusColumn_Type;
 #define PyNautilusColumn_Type (*_PyNautilusColumn_Type)
 
-PyTypeObject *_PyNautilusColumnProvider_Type;
+extern PyTypeObject *_PyNautilusColumnProvider_Type;
 #define PyNautilusColumnProvider_Type (*_PyNautilusColumnProvider_Type)
 
-PyTypeObject *_PyNautilusInfoProvider_Type;
+extern PyTypeObject *_PyNautilusInfoProvider_Type;
 #define PyNautilusInfoProvider_Type (*_PyNautilusInfoProvider_Type)
 
-PyTypeObject *_PyNautilusLocationWidgetProvider_Type;
+extern PyTypeObject *_PyNautilusLocationWidgetProvider_Type;
 #define PyNautilusLocationWidgetProvider_Type (*_PyNautilusLocationWidgetProvider_Type)
 
-PyTypeObject *_PyNautilusMenu_Type;
+extern PyTypeObject *_PyNautilusMenu_Type;
 #define PyNautilusMenu_Type (*_PyNautilusMenu_Type)
 
-PyTypeObject *_PyNautilusMenuItem_Type;
+extern PyTypeObject *_PyNautilusMenuItem_Type;
 #define PyNautilusMenuItem_Type (*_PyNautilusMenuItem_Type)
 
-PyTypeObject *_PyNautilusMenuProvider_Type;
+extern PyTypeObject *_PyNautilusMenuProvider_Type;
 #define PyNautilusMenuProvider_Type (*_PyNautilusMenuProvider_Type)
 
-PyTypeObject *_PyNautilusPropertyPage_Type;
+extern PyTypeObject *_PyNautilusPropertyPage_Type;
 #define PyNautilusPropertyPage_Type (*_PyNautilusPropertyPage_Type)
 
-PyTypeObject *_PyNautilusPropertyPageProvider_Type;
+extern PyTypeObject *_PyNautilusPropertyPageProvider_Type;
 #define PyNautilusPropertyPageProvider_Type (*_PyNautilusPropertyPageProvider_Type)
 
-PyTypeObject *_PyNautilusOperationHandle_Type;
+extern PyTypeObject *_PyNautilusOperationHandle_Type;
 #define PyNautilusOperationHandle_Type (*_PyNautilusOperationHandle_Type)
 
 #endif /* NAUTILUS_PYTHON_H */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]