[librest/wip/hadess/compilation-fixes: 1/2] demo: Fix compilation with libsoup2




commit 3028388e6876898e2b563b0c74d426b183b10ded
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Feb 2 12:34:43 2022 +0100

    demo: Fix compilation with libsoup2
    
    librest/examples/demo/demo-rest-page.c: In function ‘on_send_clicked’:
    librest/examples/demo/demo-rest-page.c:498:24: error: too few arguments to function ‘soup_logger_new’
      498 |   SoupLogger *logger = soup_logger_new (SOUP_LOGGER_LOG_BODY);
          |                        ^~~~~~~~~~~~~~~
    In file included from /usr/include/libsoup-2.4/libsoup/soup.h:31,
                     from librest/examples/demo/demo-rest-page.c:23:
    /usr/include/libsoup-2.4/libsoup/soup-logger.h:59:13: note: declared here
       59 | SoupLogger *soup_logger_new         (SoupLoggerLogLevel  level,
          |             ^~~~~~~~~~~~~~~

 examples/demo/demo-rest-page.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/examples/demo/demo-rest-page.c b/examples/demo/demo-rest-page.c
index 46ebfec..e2f71d5 100644
--- a/examples/demo/demo-rest-page.c
+++ b/examples/demo/demo-rest-page.c
@@ -495,7 +495,11 @@ on_send_clicked (GtkButton *btn,
         break;
       }
     }
+#if WITH_SOUP_2
+  SoupLogger *logger = soup_logger_new (SOUP_LOGGER_LOG_BODY, -1);
+#else
   SoupLogger *logger = soup_logger_new (SOUP_LOGGER_LOG_BODY);
+#endif
   rest_proxy_add_soup_feature (proxy, SOUP_SESSION_FEATURE (logger));
 
   RestProxyCall *call = rest_proxy_new_call (proxy);


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