[gupnp] Fix GCC warnings about unused typedefs for local includes



commit f16a62e7001d608224cedfe4fb256151798bba74
Author: Emanuele Aina <emanuele aina collabora com>
Date:   Mon Sep 16 16:14:06 2013 +0200

    Fix GCC warnings about unused typedefs for local includes
    
    GCC was complaining with the following error:
    
     error: typedef 'GUPnPNetworkManager' locally defined but not used [-Werror=unused-local-typedefs]
    
    Move the #include lines to the global scope to make it happy.
    
    Alos use #ifdef/#if defined() consistently, instead of relying on the
    defined values.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708162

 libgupnp/gupnp-context-manager.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/libgupnp/gupnp-context-manager.c b/libgupnp/gupnp-context-manager.c
index f776838..685e150 100644
--- a/libgupnp/gupnp-context-manager.c
+++ b/libgupnp/gupnp-context-manager.c
@@ -47,6 +47,14 @@
 
 #include "gupnp-unix-context-manager.h"
 
+#ifdef G_OS_WIN32
+#include "gupnp-windows-context-manager.h"
+#elif defined(USE_NETWORK_MANAGER)
+#include "gupnp-network-manager.h"
+#elif defined(USE_CONNMAN)
+#include "gupnp-connman-manager.h"
+#endif
+
 G_DEFINE_ABSTRACT_TYPE (GUPnPContextManager,
                         gupnp_context_manager,
                         G_TYPE_OBJECT);
@@ -526,19 +534,16 @@ gupnp_context_manager_create (guint port)
 #endif
         GUPnPContextManager *impl;
         GType impl_type = G_TYPE_INVALID;
-#ifdef G_OS_WIN32
-#include "gupnp-windows-context-manager.h"
 
+#ifdef G_OS_WIN32
         impl_type = GUPNP_TYPE_WINDOWS_CONTEXT_MANAGER;
 #else
-#ifdef USE_NETWORK_MANAGER
-#include "gupnp-network-manager.h"
+#if defined(USE_NETWORK_MANAGER)
         system_bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
 
         if (gupnp_network_manager_is_available ())
                 impl_type = GUPNP_TYPE_NETWORK_MANAGER;
-#elif USE_CONNMAN
-#include "gupnp-connman-manager.h"
+#elif defined(USE_CONNMAN)
         system_bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
 
        if (gupnp_connman_manager_is_available ())


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