[libepc] Use #ifdef HAVE_LIBSOUP22 instead of #if HAVE_LIBSOUP22 .



commit 36952a87bc5f3c2277a11c2f903a3587f260dde4
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Oct 28 11:49:27 2015 +0100

    Use #ifdef HAVE_LIBSOUP22 instead of #if HAVE_LIBSOUP22 .
    
    To silence compiler warnings.

 libepc/publisher.c |   28 ++++++++++++++--------------
 libepc/publisher.h |    2 +-
 2 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/libepc/publisher.c b/libepc/publisher.c
index be573a1..603492c 100644
--- a/libepc/publisher.c
+++ b/libepc/publisher.c
@@ -33,7 +33,7 @@
 #include <libsoup/soup.h>
 #include <string.h>
 
-#if HAVE_LIBSOUP22
+#ifdef HAVE_LIBSOUP22
 #include <libsoup/soup-address.h>
 #include <libsoup/soup-server.h>
 #include <libsoup/soup-server-auth.h>
@@ -177,7 +177,7 @@ struct _EpcAuthContext
   EpcPublisher   *publisher;
   const gchar    *key;
 
-#if HAVE_LIBSOUP22
+#ifdef HAVE_LIBSOUP22
   SoupServerAuth *auth;
 #else
   SoupMessage    *message;
@@ -224,7 +224,7 @@ struct _EpcPublisherPrivate
   GMainLoop             *server_loop;
   SoupServer            *server;
 
-#if HAVE_LIBSOUP22
+#ifdef HAVE_LIBSOUP22
   SoupServerAuthContext  server_auth;
 #else
   SoupAuthDomain        *server_auth;
@@ -718,7 +718,7 @@ epc_publisher_handle_root (SoupServer        *server,
 }
 
 static void
-#if HAVE_LIBSOUP22
+#ifdef HAVE_LIBSOUP22
 epc_auth_context_init (EpcAuthContext *context,
                        EpcPublisher   *publisher,
                        SoupMessage    *message,
@@ -737,7 +737,7 @@ epc_auth_context_init (EpcAuthContext *context,
   context->key = epc_publisher_get_key (uri->path);
   context->resource = NULL;
 
-#if HAVE_LIBSOUP22
+#ifdef HAVE_LIBSOUP22
   context->auth = auth;
 #else
   context->message  = message;
@@ -751,7 +751,7 @@ epc_auth_context_init (EpcAuthContext *context,
     context->resource = publisher->priv->default_resource;
 }
 
-#if HAVE_LIBSOUP22
+#ifdef HAVE_LIBSOUP22
 
 static gboolean
 epc_publisher_server_auth_cb (SoupServerAuthContext *auth_ctx G_GNUC_UNUSED,
@@ -866,7 +866,7 @@ epc_publisher_init (EpcPublisher *self)
   self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EPC_TYPE_PUBLISHER, EpcPublisherPrivate);
   self->priv->protocol = EPC_PROTOCOL_HTTPS;
 
-#if HAVE_LIBSOUP22
+#ifdef HAVE_LIBSOUP22
   self->priv->server_auth.types = SOUP_AUTH_TYPE_DIGEST;
   self->priv->server_auth.callback = epc_publisher_server_auth_cb;
   self->priv->server_auth.user_data = self;
@@ -1079,7 +1079,7 @@ epc_publisher_compute_name (EpcPublisher *self)
 static void
 epc_publisher_remove_handlers (EpcPublisher *self)
 {
-#if HAVE_LIBSOUP22
+#ifdef HAVE_LIBSOUP22
   memset (&self->priv->server_auth.digest_info, 0,
           sizeof self->priv->server_auth.digest_info);
 #else
@@ -1103,7 +1103,7 @@ epc_publisher_add_server_callback (EpcPublisher       *self,
                                    const gchar        *path,
                                    SoupServerCallback  callback)
 {
-#if HAVE_LIBSOUP22
+#ifdef HAVE_LIBSOUP22
   soup_server_add_handler (self->priv->server, path,
                            &self->priv->server_auth,
                            callback, NULL, self);
@@ -1116,7 +1116,7 @@ epc_publisher_add_server_callback (EpcPublisher       *self,
 static void
 epc_publisher_install_handlers (EpcPublisher *self)
 {
-#if HAVE_LIBSOUP22
+#ifdef HAVE_LIBSOUP22
 
   memset (&self->priv->server_auth.digest_info, 0,
           sizeof self->priv->server_auth.digest_info);
@@ -1307,7 +1307,7 @@ epc_publisher_real_set_auth_flags (EpcPublisher *self,
   if (self->priv->server)
     epc_publisher_remove_handlers (self);
 
-#if HAVE_LIBSOUP22
+#ifdef HAVE_LIBSOUP22
   self->priv->server_auth.types =
     flags & EPC_AUTH_PASSWORD_TEXT_NEEDED ?
     SOUP_AUTH_TYPE_BASIC : SOUP_AUTH_TYPE_DIGEST;
@@ -2477,7 +2477,7 @@ epc_publisher_run_async (EpcPublisher  *self,
   if (!self->priv->server_started)
     {
       soup_server_run_async (self->priv->server);
-#if HAVE_LIBSOUP22
+#ifdef HAVE_LIBSOUP22
       g_object_unref (self->priv->server); /* work arround bug #494128 */
 #endif
       self->priv->server_started = TRUE;
@@ -2758,7 +2758,7 @@ epc_auth_context_get_password (const EpcAuthContext *context)
 {
   g_return_val_if_fail (NULL != context, NULL);
 
-#if HAVE_LIBSOUP22
+#ifdef HAVE_LIBSOUP22
 
   if (NULL != context->auth &&
       SOUP_AUTH_TYPE_BASIC == context->auth->type)
@@ -2792,7 +2792,7 @@ epc_auth_context_check_password (const EpcAuthContext *context,
   g_return_val_if_fail (NULL != context, FALSE);
   g_return_val_if_fail (NULL != password, FALSE);
 
-#if HAVE_LIBSOUP22
+#ifdef HAVE_LIBSOUP22
 
   return
     NULL != context->auth &&
diff --git a/libepc/publisher.h b/libepc/publisher.h
index eaa2ee9..c087133 100644
--- a/libepc/publisher.h
+++ b/libepc/publisher.h
@@ -101,7 +101,7 @@ typedef gboolean    (*EpcAuthHandler)    (EpcAuthContext *context,
  * These flags specify the authentication behaviour of an #EpcPublisher.
  */
 
-typedef enum /* <flags> */
+typedef enum /*< flags >*/
 {
   EPC_AUTH_DEFAULT =                     0,
   EPC_AUTH_PASSWORD_TEXT_NEEDED =       (1 << 0)


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