[mutter] meta: Only declare types when generating gir files



commit 1bbb5c8107ab77435f97c1b037a89a76121f6e3c
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Sun Jan 20 17:41:53 2019 +0100

    meta: Only declare types when generating gir files
    
    Some types were declared in the public headers so that g-ir-scanner
    could resolve the types. This caused warnings when using
    -Wredundant-decls, so only redeclare them for the gir scanner.

 src/meta/meta-backend.h              | 4 ++++
 src/meta/meta-monitor-manager.h      | 2 ++
 src/meta/meta-startup-notification.h | 4 ++++
 3 files changed, 10 insertions(+)
---
diff --git a/src/meta/meta-backend.h b/src/meta/meta-backend.h
index d6552c201..ca8442a08 100644
--- a/src/meta/meta-backend.h
+++ b/src/meta/meta-backend.h
@@ -34,6 +34,10 @@
 typedef struct _MetaBackend        MetaBackend;
 typedef struct _MetaBackendClass   MetaBackendClass;
 
+#ifdef __GI_SCANNER__
+GType meta_backend_get_type (void);
+#endif
+
 MetaBackend * meta_get_backend (void);
 
 void meta_backend_set_keymap (MetaBackend *backend,
diff --git a/src/meta/meta-monitor-manager.h b/src/meta/meta-monitor-manager.h
index 0e7b93016..6545ccf7c 100644
--- a/src/meta/meta-monitor-manager.h
+++ b/src/meta/meta-monitor-manager.h
@@ -54,7 +54,9 @@ MetaMonitorSwitchConfigType meta_monitor_manager_get_switch_config (MetaMonitorM
 
 gint meta_monitor_manager_get_display_configuration_timeout (void);
 
+#ifdef __GI_SCANNER__
 /* Re-declaration of parent type for introspection */
 GType meta_dbus_display_config_skeleton_get_type (void) G_GNUC_CONST;
+#endif
 
 #endif /* META_MONITOR_MANAGER_H */
diff --git a/src/meta/meta-startup-notification.h b/src/meta/meta-startup-notification.h
index 106f336a0..dfa7686df 100644
--- a/src/meta/meta-startup-notification.h
+++ b/src/meta/meta-startup-notification.h
@@ -27,7 +27,9 @@
 typedef struct _MetaStartupNotification MetaStartupNotification;
 typedef struct _MetaStartupSequence MetaStartupSequence;
 
+#ifdef __GI_SCANNER__
 GType         meta_startup_notification_get_type      (void);
+#endif
 
 /**
  * meta_startup_notification_get_sequences: (skip)
@@ -37,7 +39,9 @@ GSList *      meta_startup_notification_get_sequences (MetaStartupNotification *
 MetaLaunchContext *
              meta_startup_notification_create_launcher (MetaStartupNotification *sn);
 
+#ifdef __GI_SCANNER__
 GType         meta_startup_sequence_get_type          (void);
+#endif
 
 const char * meta_startup_sequence_get_id             (MetaStartupSequence *sequence);
 gboolean     meta_startup_sequence_get_completed      (MetaStartupSequence *sequence);


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