diff options
author | Dan Winship <danw@gnome.org> | 2013-04-24 11:34:30 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2013-04-24 11:39:50 -0400 |
commit | c48b661a18bad9e98737be9522ebadf54be29fd6 (patch) | |
tree | d8623c43009a14c8be531aa4081166e449fa74d4 | |
parent | 3943610faed4922b739162f244f32e0b2393cba0 (diff) | |
download | libsoup-c48b661a18bad9e98737be9522ebadf54be29fd6.tar.gz libsoup-c48b661a18bad9e98737be9522ebadf54be29fd6.tar.bz2 libsoup-c48b661a18bad9e98737be9522ebadf54be29fd6.zip |
Fix build on Windows, deprecate soup-portability.h
soup-portability.h created portability problems (ha!) because the
windows headers do "#define interface struct", conflicting with
variable names elsewhere.
The only thing that needed soup-portability.h in the public headers
was soup-address.h, which uses struct sockaddr. But we can just do a
forward declaration of that type rather than actually pulling in the
headers.
In git master, we made soup-address.h stop including
soup-portability.h, but that might possibly break some other modules
that depended on implicitly getting network includes as a side effect
of including soup.h, and we shouldn't be doing that in the stable
branch. So instead, we just tweak things so that it doesn't get
included from within libsoup, but still does externally.
https://bugzilla.gnome.org/show_bug.cgi?id=692134
-rw-r--r-- | libsoup/Makefile.am | 1 | ||||
-rw-r--r-- | libsoup/soup-address.c | 2 | ||||
-rw-r--r-- | libsoup/soup-address.h | 4 | ||||
-rw-r--r-- | libsoup/soup-socket.c | 2 | ||||
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/connection-test.c | 2 | ||||
-rw-r--r-- | tests/socket-test.c | 6 |
7 files changed, 14 insertions, 4 deletions
diff --git a/libsoup/Makefile.am b/libsoup/Makefile.am index d54a06a9..508bf9c8 100644 --- a/libsoup/Makefile.am +++ b/libsoup/Makefile.am @@ -11,6 +11,7 @@ endif INCLUDES = \ -DG_LOG_DOMAIN=\"libsoup\" \ -DLOCALEDIR=\"$(localedir)\" \ + -DSOUP_COMPILATION \ -I$(top_srcdir) \ -I$(top_builddir) \ $(SOUP_DEBUG_FLAGS) \ diff --git a/libsoup/soup-address.c b/libsoup/soup-address.c index 286be8c7..da4da948 100644 --- a/libsoup/soup-address.c +++ b/libsoup/soup-address.c @@ -11,6 +11,8 @@ #include <string.h> +#include <gio/gnetworking.h> + #include "soup-address.h" #include "soup.h" #include "soup-marshal.h" diff --git a/libsoup/soup-address.h b/libsoup/soup-address.h index dd4c275d..f882a080 100644 --- a/libsoup/soup-address.h +++ b/libsoup/soup-address.h @@ -8,7 +8,9 @@ #include <sys/types.h> +#ifndef SOUP_COMPILATION #include <libsoup/soup-portability.h> +#endif #include <libsoup/soup-types.h> G_BEGIN_DECLS @@ -51,6 +53,8 @@ typedef enum { #define SOUP_ADDRESS_ANY_PORT 0 +struct sockaddr; + typedef void (*SoupAddressCallback) (SoupAddress *addr, guint status, gpointer user_data); diff --git a/libsoup/soup-socket.c b/libsoup/soup-socket.c index 4268429b..9e4de132 100644 --- a/libsoup/soup-socket.c +++ b/libsoup/soup-socket.c @@ -11,6 +11,8 @@ #include <string.h> +#include <gio/gnetworking.h> + #include "soup-socket.h" #include "soup.h" #include "soup-filter-input-stream.h" diff --git a/tests/Makefile.am b/tests/Makefile.am index 417b04c7..7407dfec 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,6 +2,7 @@ INCLUDES = \ -I$(top_srcdir) \ -DSRCDIR=\""$(abs_srcdir)"\" \ -DBUILDDIR=\""$(builddir)"\" \ + -DSOUP_COMPILATION \ $(GLIB_CFLAGS) LIBS = \ diff --git a/tests/connection-test.c b/tests/connection-test.c index b7211363..6dc7c005 100644 --- a/tests/connection-test.c +++ b/tests/connection-test.c @@ -5,6 +5,8 @@ #include "test-utils.h" +#include <gio/gnetworking.h> + SoupServer *server; SoupURI *base_uri; GMutex server_mutex; diff --git a/tests/socket-test.c b/tests/socket-test.c index 60c3e86c..42ab6c8b 100644 --- a/tests/socket-test.c +++ b/tests/socket-test.c @@ -4,12 +4,10 @@ * Copyright 2012 Nokia Corporation */ -#include <libsoup/soup.h> - -#include <string.h> - #include "test-utils.h" +#include <gio/gnetworking.h> + static void do_unconnected_socket_test (void) { |