After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757146 - Use export-dynamic to export the symbols and add an AVAILABLE_IN_2_4 for all the symbols not marked already
Use export-dynamic to export the symbols and add an AVAILABLE_IN_2_4 for all ...
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: API
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2015-10-26 17:00 UTC by Ignacio Casal Quinteiro (nacho)
Modified: 2015-11-24 14:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Provide a _SOUP_EXTERN so we ensure the methods get externalized (10.34 KB, patch)
2015-10-26 18:41 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Remove AVAILABLE from methods marked as DEPRECATED (6.30 KB, patch)
2015-10-26 18:42 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Add SOUP_AVAILABLE_IN_2_4 and mark externalized methods with it (44.89 KB, patch)
2015-10-26 18:43 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Remove .sym files since they are not needed anymore (44.12 KB, patch)
2015-10-26 18:44 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Fix some signed/unsigned missmatch warnings (7.27 KB, patch)
2015-10-26 19:24 UTC, Ignacio Casal Quinteiro (nacho)
committed Details | Review
Mark externalized methods with SOUP_AVAILABLE_IN_2_4 (57.34 KB, patch)
2015-10-27 09:31 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Properly handle the visibility of the methods (19.62 KB, patch)
2015-10-27 09:31 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Provide a _SOUP_EXTERN so we ensure the methods get externalized (11.95 KB, patch)
2015-10-27 09:32 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Provide a _SOUP_EXTERN so we ensure the methods get externalized (12.10 KB, patch)
2015-10-27 10:14 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Mark externalized methods with SOUP_AVAILABLE_IN_2_4 (57.18 KB, patch)
2015-10-27 10:14 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Properly handle the visibility of the methods (19.62 KB, patch)
2015-10-27 10:14 UTC, Ignacio Casal Quinteiro (nacho)
committed Details | Review
Declare a SOUP_VAR to externalize variables (3.15 KB, patch)
2015-10-27 12:26 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Declare a SOUP_VAR to externalize variables (4.32 KB, patch)
2015-10-29 10:33 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
websocket-test: remove useless include (654 bytes, patch)
2015-10-29 10:54 UTC, Ignacio Casal Quinteiro (nacho)
committed Details | Review
Do not mark private method as available (713 bytes, patch)
2015-10-29 14:33 UTC, Ignacio Casal Quinteiro (nacho)
committed Details | Review
Mark soup_message_io_cleanup as available (1.00 KB, patch)
2015-10-29 15:17 UTC, Ignacio Casal Quinteiro (nacho)
committed Details | Review
Use G_DEPRECATED instead of GLIB_DEPRECATED (7.64 KB, patch)
2015-11-02 14:34 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Mark old session-(async|sync) methods as deprecated (9.29 KB, patch)
2015-11-03 08:59 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Use the proper glib version macros (10.50 KB, patch)
2015-11-03 09:00 UTC, Ignacio Casal Quinteiro (nacho)
committed Details | Review
Provide a _SOUP_EXTERN so we ensure the methods get externalized (7.81 KB, patch)
2015-11-03 09:11 UTC, Ignacio Casal Quinteiro (nacho)
committed Details | Review
Declare a SOUP_VAR to externalize variables (3.99 KB, patch)
2015-11-03 09:12 UTC, Ignacio Casal Quinteiro (nacho)
committed Details | Review
Makefile.glib: ensure config.h is included if needed (1017 bytes, patch)
2015-11-03 09:59 UTC, Ignacio Casal Quinteiro (nacho)
committed Details | Review
Include config.h if needed in the files that do not include it yet (3.56 KB, patch)
2015-11-03 10:00 UTC, Ignacio Casal Quinteiro (nacho)
committed Details | Review
Makefile.glib patch (1.81 KB, patch)
2015-11-03 10:27 UTC, Paolo Borelli
none Details | Review
Makefile.glib pach (1.27 KB, patch)
2015-11-03 11:00 UTC, Paolo Borelli
committed Details | Review
Rebased patch to export all methods (53.93 KB, patch)
2015-11-03 11:03 UTC, Paolo Borelli
committed Details | Review
Mark old session-(async|sync) methods as deprecated (7.27 KB, patch)
2015-11-22 16:36 UTC, Dan Winship
committed Details | Review

Description Ignacio Casal Quinteiro (nacho) 2015-10-26 17:00:57 UTC
In the branch wip/nacho/soup-extern (let me know if I should attach the patches here) there are a few things fixed:
first a _SOUP_EXTERN define is defined which basically is a "extern" on linux and the windows magic on Windows (the windows magic is added in a config file, which will be added upstream once the msvc projects are ready)
second the sym files are removed. This means the private methods are now marked as internal so only the methods that were in the sym files are getting exported.
Comment 1 Ignacio Casal Quinteiro (nacho) 2015-10-26 18:41:23 UTC
Created attachment 314154 [details] [review]
Provide a _SOUP_EXTERN so we ensure the methods get externalized

Change the defines to endup using _SOUP_EXTERN so we get
them externalized.
Comment 2 Ignacio Casal Quinteiro (nacho) 2015-10-26 18:42:49 UTC
Created attachment 314155 [details] [review]
Remove AVAILABLE from methods marked as DEPRECATED

GLib and Gtk do the same so let's do it so we avoid
having the extern defined twice
Comment 3 Ignacio Casal Quinteiro (nacho) 2015-10-26 18:43:46 UTC
Created attachment 314156 [details] [review]
Add SOUP_AVAILABLE_IN_2_4 and mark externalized methods with it

This way we can as well redefine _SOUP_EXTERN on msvc builds
with the right extern value needed for it. This is the same
we do on glib and gtk+
Comment 4 Ignacio Casal Quinteiro (nacho) 2015-10-26 18:44:13 UTC
Created attachment 314157 [details] [review]
Remove .sym files since they are not needed anymore

We use -export-dynamic and we mark the methods that we do
not want to export as INTERNAL
Comment 5 Ignacio Casal Quinteiro (nacho) 2015-10-26 19:24:00 UTC
Created attachment 314158 [details] [review]
Fix some signed/unsigned missmatch warnings
Comment 6 Ignacio Casal Quinteiro (nacho) 2015-10-26 19:24:35 UTC
Adding here also the patch for the warnings, since anyway it was related with the msvc builds.
Comment 7 Dan Winship 2015-10-26 20:58:26 UTC
(In reply to Ignacio Casal Quinteiro (nacho) from comment #2)
> Created attachment 314155 [details] [review] [review]
> Remove AVAILABLE from methods marked as DEPRECATED
> 
> GLib and Gtk do the same so let's do it so we avoid
> having the extern defined twice

Ah, right, I knew there was some reason I didn't like the GLib system.

I would prefer to have it so that only the AVAILABLE_IN macros do the exporting, so that we can still specify both AVAILABLE_IN and DEPRECATED_IN versions on a symbol.
Comment 8 Ignacio Casal Quinteiro (nacho) 2015-10-27 07:36:00 UTC
(In reply to Dan Winship from comment #7)
> (In reply to Ignacio Casal Quinteiro (nacho) from comment #2)
> > Created attachment 314155 [details] [review] [review] [review]
> > Remove AVAILABLE from methods marked as DEPRECATED
> > 
> > GLib and Gtk do the same so let's do it so we avoid
> > having the extern defined twice
> 
> Ah, right, I knew there was some reason I didn't like the GLib system.
> 
> I would prefer to have it so that only the AVAILABLE_IN macros do the
> exporting, so that we can still specify both AVAILABLE_IN and DEPRECATED_IN
> versions on a symbol.

So, I double checked and we can't go that way, since GLIB_DEPRECATED means extern as well, so we would end up with extern extern. We really need to have AVAILABLE or DEPRECATED but not both at the same time.
Comment 9 Ignacio Casal Quinteiro (nacho) 2015-10-27 08:39:36 UTC
Scratch my last comment. New patches are coming.
Comment 10 Ignacio Casal Quinteiro (nacho) 2015-10-27 09:31:20 UTC
Created attachment 314198 [details] [review]
Mark externalized methods with SOUP_AVAILABLE_IN_2_4

This way we can as well redefine _SOUP_EXTERN on msvc builds
with the right extern value needed for it. This is the same
we do on glib and gtk+
Comment 11 Ignacio Casal Quinteiro (nacho) 2015-10-27 09:31:30 UTC
Created attachment 314199 [details] [review]
Properly handle the visibility of the methods
Comment 12 Ignacio Casal Quinteiro (nacho) 2015-10-27 09:32:26 UTC
Created attachment 314200 [details] [review]
Provide a _SOUP_EXTERN so we ensure the methods get externalized

Change the defines to endup using _SOUP_EXTERN so we get
them externalized.
Comment 13 Ignacio Casal Quinteiro (nacho) 2015-10-27 10:14:31 UTC
Created attachment 314202 [details] [review]
Provide a _SOUP_EXTERN so we ensure the methods get externalized

Change the defines to endup using _SOUP_EXTERN so we get
them externalized.
Comment 14 Ignacio Casal Quinteiro (nacho) 2015-10-27 10:14:39 UTC
Created attachment 314203 [details] [review]
Mark externalized methods with SOUP_AVAILABLE_IN_2_4

This way we can as well redefine _SOUP_EXTERN on msvc builds
with the right extern value needed for it. This is the same
we do on glib and gtk+
Comment 15 Ignacio Casal Quinteiro (nacho) 2015-10-27 10:14:49 UTC
Created attachment 314204 [details] [review]
Properly handle the visibility of the methods
Comment 16 Ignacio Casal Quinteiro (nacho) 2015-10-27 12:26:36 UTC
Created attachment 314219 [details] [review]
Declare a SOUP_VAR to externalize variables

This is needed to properly externalize the variables
on windows. Since we need to handle dllexport vs dllimport
Comment 17 Ignacio Casal Quinteiro (nacho) 2015-10-29 10:33:56 UTC
Created attachment 314376 [details] [review]
Declare a SOUP_VAR to externalize variables

This is needed to properly externalize the variables
on windows. Since we need to handle dllexport vs dllimport
Comment 18 Ignacio Casal Quinteiro (nacho) 2015-10-29 10:54:40 UTC
Created attachment 314377 [details] [review]
websocket-test: remove useless include

This way we can build it on windows
Comment 19 Ignacio Casal Quinteiro (nacho) 2015-10-29 14:33:11 UTC
Created attachment 314403 [details] [review]
Do not mark private method as available
Comment 20 Ignacio Casal Quinteiro (nacho) 2015-10-29 14:34:33 UTC
This is the current diff after all those changes:

--- libsoup.txt 2015-10-29 15:27:46.890745263 +0100
+++ ../../libsoup.master.txt    2015-10-26 16:52:45.679773582 +0100
@@ -24,4 +23,0 @@
-__bss_start
-_end
-_fini
-_init
@@ -306,0 +303 @@
+soup_message_io_cleanup

soup_message_io_cleanup is a private method that was marked before as external. Now it should be fixed with these patches.
Comment 21 Dan Winship 2015-10-29 15:10:24 UTC
(In reply to Ignacio Casal Quinteiro (nacho) from comment #20)
> +soup_message_io_cleanup
> 
> soup_message_io_cleanup is a private method that was marked before as
> external. Now it should be fixed with these patches.

oh, no, that's actually intentional. There were people using it from before libsoup started doing symbol visibility. (eg, bug 687758, bug 687468). Those are both fixed now but there might have been others.
Comment 22 Ignacio Casal Quinteiro (nacho) 2015-10-29 15:14:15 UTC
I guess the solution then, is to add the AVAILABLE macro to it. Thoughts?
Comment 23 Ignacio Casal Quinteiro (nacho) 2015-10-29 15:17:16 UTC
Created attachment 314410 [details] [review]
Mark soup_message_io_cleanup as available

Even if it is private it was exported before
so we need to keep it that way.
Comment 24 Dan Winship 2015-11-02 14:15:06 UTC
Comment on attachment 314202 [details] [review]
Provide a _SOUP_EXTERN so we ensure the methods get externalized

The commit message here isn't very good. Maybe be more explicit that this is just about setting things up for a later patch.

>+#ifdef HAVE_CONFIG_H
>+#include <config.h>
>+#endif

You shouldn't include config.h from an installed header.

>+#define SOUP_DEPRECATED G_DEPRECATED
>...
>-# define SOUP_DEPRECATED_IN_2_24                GLIB_DEPRECATED
>+# define SOUP_DEPRECATED_IN_2_24                SOUP_DEPRECATED

This is a distinct bugfix from the rest of the patch; the glib docs explicitly say to use G_DEPRECATED rather than GLIB_DEPRECATED, so all this code was wrong before and that should be fixed separately from the extern stuff.
Comment 25 Ignacio Casal Quinteiro (nacho) 2015-11-02 14:34:07 UTC
Created attachment 314644 [details] [review]
Use G_DEPRECATED instead of GLIB_DEPRECATED

As pointed out by the docs we should use G_DEPRECATED
instead of GLIB_DEPRECATED
Comment 26 Dan Winship 2015-11-02 14:43:43 UTC
Comment on attachment 314203 [details] [review]
Mark externalized methods with SOUP_AVAILABLE_IN_2_4

>Subject: [PATCH] Mark externalized methods with SOUP_AVAILABLE_IN_2_4

"Mark all remaining public methods with SOUP_AVAILABLE_IN_2_4"

>--- a/Makefile.glib
>+++ b/Makefile.glib

although it's not clear if it's ever going to happen now, this is supposed to be a generic non-libsoup-specific header (bug 654395). So, don't make libsoup-specific changes to it; set soup_enum_types_MKENUMS_H_FLAGS in libsoup/Makefile.am.

"But Dan, that won't work, it doesn't let you override --vhead". Grumble grumble. Yeah, not sure. Although:

>+		--vhead "SOUP_AVAILABLE_IN_2_4 GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n" \

"SOUP_AVAILABLE_IN_2_4" is wrong anyway; if we can't get the right version numbers, we should be using just _SOUP_EXTERN.

>-extern gpointer _SOUP_METHOD_OPTIONS;
>+SOUP_AVAILABLE_IN_2_4
>+gpointer _SOUP_METHOD_OPTIONS;

Those need to be marked "extern" even on unix. You need to do the equivalent of the GLIB_VAR stuff.

(likewise with other exported variables)

> #include <glib-object.h>
>+#include <libsoup/soup-types.h>

You can drop <glib-object.h> when adding <libsoup/soup-types.h>

>+SOUP_AVAILABLE_IN_2_4
>+SOUP_DEPRECATED_IN_2_42
> GType soup_session_async_get_type (void);

This wasn't an oversight; I had left the old soup-session-async and soup-session-sync methods undeprecated to give people time to port over without getting annoying warnings. I think it's probably time to deprecate them now, but that should be a separate patch. (And should involve fixing all the warnings this causes in tests/ and examples/. So feel free to just skip that for now.)

>-/* SOUP_AVAILABLE_IN_2_30 -- this trips up gtkdoc-scan */
>+SOUP_AVAILABLE_IN_2_30
> SOUP_DEPRECATED_IN_2_38_FOR (soup_session_prefetch_dns)
> void            soup_session_prepare_for_uri  (SoupSession           *session,

Hm... I'd forgotten about this. Need to figure out the current status here with gtk-doc.
Comment 27 Dan Winship 2015-11-02 14:47:36 UTC
Comment on attachment 314204 [details] [review]
Properly handle the visibility of the methods

>-	-export-symbols $(srcdir)/libsoup-2.4.sym \
>+	-export-dynamic \

Is -export-dynamic actually needed here?
Comment 28 Dan Winship 2015-11-02 14:48:38 UTC
Comment on attachment 314376 [details] [review]
Declare a SOUP_VAR to externalize variables

ok, right. but this is in the wrong order in the commit chain; you shouldn't first break it and then fix it again
Comment 29 Ignacio Casal Quinteiro (nacho) 2015-11-02 14:53:31 UTC
Attachment 314377 [details] pushed as cd43855 - websocket-test: remove useless include
Attachment 314403 [details] pushed as 7e4e2c0 - Do not mark private method as available
Comment 30 Ignacio Casal Quinteiro (nacho) 2015-11-03 08:59:33 UTC
Created attachment 314701 [details] [review]
Mark old session-(async|sync) methods as deprecated

They were not marked as deprecated yet to give people time to port over
without getting annoying warnings. Now that we are at the start
of a cycle let's mark them.
Fix all the consequent deprecation warnings.
Comment 31 Ignacio Casal Quinteiro (nacho) 2015-11-03 09:00:11 UTC
Created attachment 314702 [details] [review]
Use the proper glib version macros

Use G_DEPRECATED instead of GLIB_DEPRECATED and G_ENCODE_VERSION instead
of our own macro
Comment 32 Ignacio Casal Quinteiro (nacho) 2015-11-03 09:11:41 UTC
Created attachment 314706 [details] [review]
Provide a _SOUP_EXTERN so we ensure the methods get externalized

Change the defines to endup using _SOUP_EXTERN so we get
them externalized.
Comment 33 Ignacio Casal Quinteiro (nacho) 2015-11-03 09:12:43 UTC
Created attachment 314707 [details] [review]
Declare a SOUP_VAR to externalize variables

This is needed to properly externalize the variables
on windows. Since we need to handle dllexport vs dllimport
Comment 34 Ignacio Casal Quinteiro (nacho) 2015-11-03 09:59:47 UTC
Created attachment 314710 [details] [review]
Makefile.glib: ensure config.h is included if needed
Comment 35 Ignacio Casal Quinteiro (nacho) 2015-11-03 10:00:32 UTC
Created attachment 314711 [details] [review]
Include config.h if needed in the files that do not include it yet
Comment 36 Paolo Borelli 2015-11-03 10:27:53 UTC
Created attachment 314713 [details] [review]
Makefile.glib patch

For the Makefile.glib issue, what about the following approach: we add a GLIB_MKENUMS_EXTERN to the template and then we make sure in our H_FLAGS to define it as _SOUP_EXTERN.

If the approach is ok, I can split this patch in two: a change to Makefile.glib to be fed back into glib and the Makefile.am part to be squashed into nacho's patchset
Comment 37 Paolo Borelli 2015-11-03 11:00:26 UTC
Created attachment 314720 [details] [review]
Makefile.glib pach

Actually, let me split that up already, so that if it is ok it can go in
Comment 38 Paolo Borelli 2015-11-03 11:03:17 UTC
Created attachment 314721 [details] [review]
Rebased patch to export all methods

Nacho's patch, rebased to use the modified Makefile.glib
Comment 39 Dan Winship 2015-11-04 13:51:07 UTC
Comment on attachment 314701 [details] [review]
Mark old session-(async|sync) methods as deprecated

>+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
> 	if (!item->new_api) {
> 		gboolean blocking =
> 			SOUP_IS_SESSION_SYNC (item->session) ||
> 			(!SOUP_IS_SESSION_ASYNC (item->session) && !item->async);
> 		io_run (item->msg, blocking);
> 	}
>+	G_GNUC_END_IGNORE_DEPRECATIONS;

You can wrap just the declaration/assignment (leaving io_run() outside the IGNORE_DEPRECATIONS).

>+SOUP_DEPRECATED_IN_2_42
> SoupSession *soup_session_async_new              (void);
>+SOUP_DEPRECATED_IN_2_42
> SoupSession *soup_session_async_new_with_options (const char *optname1,
> 						  ...) G_GNUC_NULL_TERMINATED;

SOUP_DEPRECATED_IN_2_42_FOR(soup_session_new), etc

>+is_session_sync(SoupSession *session)

space before the "("

>+{
>+	gboolean is_sync = FALSE;
>+
>+	G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
>+	is_sync = SOUP_IS_SESSION_SYNC (session);
>+	G_GNUC_END_IGNORE_DEPRECATIONS;
>+
>+	return is_sync;
>+}

You can do just

    G_GNUC_BEGIN_IGNORE_DEPRECATIONS
    return SOUP_IS_SESSION_SYNC (session);
    G_GNUC_END_IGNORE_DEPRECATIONS
Comment 40 Dan Winship 2015-11-04 13:54:25 UTC
Comment on attachment 314706 [details] [review]
Provide a _SOUP_EXTERN so we ensure the methods get externalized

>From bdd5042203bc8f9f33e36ebd0bfcd926d0529039 Mon Sep 17 00:00:00 2001
>From: Ignacio Casal Quinteiro <icq@gnome.org>
>Date: Mon, 26 Oct 2015 15:47:13 +0100
>Subject: [PATCH] Provide a _SOUP_EXTERN so we ensure the methods get
> externalized
>
>Change the defines to endup using _SOUP_EXTERN so we get
>them externalized.
>
>https://bugzilla.gnome.org/show_bug.cgi?id=757146
>---
> libsoup/soup-version.h.in | 66 ++++++++++++++++++++++++++---------------------
> 1 file changed, 36 insertions(+), 30 deletions(-)
>
>diff --git a/libsoup/soup-version.h.in b/libsoup/soup-version.h.in
>index 86a352d..5c2c7a3 100644
>--- a/libsoup/soup-version.h.in
>+++ b/libsoup/soup-version.h.in
>@@ -22,6 +22,10 @@ G_BEGIN_DECLS
>     (SOUP_MAJOR_VERSION == (major) && SOUP_MINOR_VERSION == (minor) && \
>      SOUP_MICRO_VERSION >= (micro)))
> 
>+#ifndef _SOUP_EXTERN
>+#define _SOUP_EXTERN extern
>+#endif
>+
> guint    soup_get_major_version (void);
> 
> guint    soup_get_minor_version (void);
>@@ -89,6 +93,8 @@ gboolean soup_check_version     (guint major,
> #error "SOUP_VERSION_MIN_REQUIRED must be >= SOUP_VERSION_2_24"
> #endif
> 
>+#define SOUP_AVAILABLE_IN_2_4                   _SOUP_EXTERN
>+
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_24
> # define SOUP_DEPRECATED_IN_2_24                G_DEPRECATED
> # define SOUP_DEPRECATED_IN_2_24_FOR(f)         G_DEPRECATED_FOR(f)
>@@ -98,9 +104,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_24
>-# define SOUP_AVAILABLE_IN_2_24                 GLIB_UNAVAILABLE(2, 24)
>+# define SOUP_AVAILABLE_IN_2_24                 G_UNAVAILABLE(2, 24) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_24
>+# define SOUP_AVAILABLE_IN_2_24                 _SOUP_EXTERN
> #endif
> 
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_26
>@@ -112,9 +118,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_26
>-# define SOUP_AVAILABLE_IN_2_26                 GLIB_UNAVAILABLE(2, 26)
>+# define SOUP_AVAILABLE_IN_2_26                 G_UNAVAILABLE(2, 26) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_26
>+# define SOUP_AVAILABLE_IN_2_26                 _SOUP_EXTERN
> #endif
> 
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_28
>@@ -126,9 +132,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_28
>-# define SOUP_AVAILABLE_IN_2_28                 GLIB_UNAVAILABLE(2, 28)
>+# define SOUP_AVAILABLE_IN_2_28                 G_UNAVAILABLE(2, 28) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_28
>+# define SOUP_AVAILABLE_IN_2_28                 _SOUP_EXTERN
> #endif
> 
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_30
>@@ -140,9 +146,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_30
>-# define SOUP_AVAILABLE_IN_2_30                 GLIB_UNAVAILABLE(2, 30)
>+# define SOUP_AVAILABLE_IN_2_30                 G_UNAVAILABLE(2, 30) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_30
>+# define SOUP_AVAILABLE_IN_2_30                 _SOUP_EXTERN
> #endif
> 
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_32
>@@ -154,9 +160,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_32
>-# define SOUP_AVAILABLE_IN_2_32                 GLIB_UNAVAILABLE(2, 32)
>+# define SOUP_AVAILABLE_IN_2_32                 G_UNAVAILABLE(2, 32) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_32
>+# define SOUP_AVAILABLE_IN_2_32                 _SOUP_EXTERN
> #endif
> 
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_34
>@@ -168,9 +174,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_34
>-# define SOUP_AVAILABLE_IN_2_34                 GLIB_UNAVAILABLE(2, 34)
>+# define SOUP_AVAILABLE_IN_2_34                 G_UNAVAILABLE(2, 34) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_34
>+# define SOUP_AVAILABLE_IN_2_34                 _SOUP_EXTERN
> #endif
> 
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_36
>@@ -182,9 +188,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_36
>-# define SOUP_AVAILABLE_IN_2_36                 GLIB_UNAVAILABLE(2, 36)
>+# define SOUP_AVAILABLE_IN_2_36                 G_UNAVAILABLE(2, 36) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_36
>+# define SOUP_AVAILABLE_IN_2_36                 _SOUP_EXTERN
> #endif
> 
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_38
>@@ -196,9 +202,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_38
>-# define SOUP_AVAILABLE_IN_2_38                 GLIB_UNAVAILABLE(2, 38)
>+# define SOUP_AVAILABLE_IN_2_38                 G_UNAVAILABLE(2, 38) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_38
>+# define SOUP_AVAILABLE_IN_2_38                 _SOUP_EXTERN
> #endif
> 
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_40
>@@ -210,9 +216,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_40
>-# define SOUP_AVAILABLE_IN_2_40                 GLIB_UNAVAILABLE(2, 40)
>+# define SOUP_AVAILABLE_IN_2_40                 G_UNAVAILABLE(2, 40) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_40
>+# define SOUP_AVAILABLE_IN_2_40                 _SOUP_EXTERN
> #endif
> 
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_42
>@@ -224,9 +230,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_42
>-# define SOUP_AVAILABLE_IN_2_42                 GLIB_UNAVAILABLE(2, 42)
>+# define SOUP_AVAILABLE_IN_2_42                 G_UNAVAILABLE(2, 42) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_42
>+# define SOUP_AVAILABLE_IN_2_42                 _SOUP_EXTERN
> #endif
> 
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_44
>@@ -238,9 +244,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_44
>-# define SOUP_AVAILABLE_IN_2_44                 GLIB_UNAVAILABLE(2, 44)
>+# define SOUP_AVAILABLE_IN_2_44                 G_UNAVAILABLE(2, 44) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_44
>+# define SOUP_AVAILABLE_IN_2_44                 _SOUP_EXTERN
> #endif
> 
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_46
>@@ -252,9 +258,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_46
>-# define SOUP_AVAILABLE_IN_2_46                 GLIB_UNAVAILABLE(2, 46)
>+# define SOUP_AVAILABLE_IN_2_46                 G_UNAVAILABLE(2, 46) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_46
>+# define SOUP_AVAILABLE_IN_2_46                 _SOUP_EXTERN
> #endif
> 
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_48
>@@ -266,9 +272,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_48
>-# define SOUP_AVAILABLE_IN_2_48                 GLIB_UNAVAILABLE(2, 48)
>+# define SOUP_AVAILABLE_IN_2_48                 G_UNAVAILABLE(2, 48) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_48
>+# define SOUP_AVAILABLE_IN_2_48                 _SOUP_EXTERN
> #endif
> 
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_50
>@@ -280,9 +286,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_50
>-# define SOUP_AVAILABLE_IN_2_50                 GLIB_UNAVAILABLE(2, 50)
>+# define SOUP_AVAILABLE_IN_2_50                 G_UNAVAILABLE(2, 50) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_50
>+# define SOUP_AVAILABLE_IN_2_50                 _SOUP_EXTERN
> #endif
> 
> #if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_52
>@@ -294,9 +300,9 @@ gboolean soup_check_version     (guint major,
> #endif
> 
> #if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_52
>-# define SOUP_AVAILABLE_IN_2_52                 GLIB_UNAVAILABLE(2, 52)
>+# define SOUP_AVAILABLE_IN_2_52                 G_UNAVAILABLE(2, 52) _SOUP_EXTERN
> #else
>-# define SOUP_AVAILABLE_IN_2_52
>+# define SOUP_AVAILABLE_IN_2_52                 _SOUP_EXTERN
> #endif
> 
> G_END_DECLS
>-- 
>2.4.3
Comment 41 Dan Winship 2015-11-04 13:54:51 UTC
(oops)
Comment 42 Dan Winship 2015-11-04 14:01:29 UTC
OK, assuming this builds on mingw and msvc, and passes "make check" on mingw at least to the same extent that it used to, and passes "make distcheck" on linux (with all optional packages installed so no tests get skipped), then this is ok to commit.
Comment 43 Ignacio Casal Quinteiro (nacho) 2015-11-04 18:55:26 UTC
Attachment 314710 [details] pushed as 67241fe - Makefile.glib: ensure config.h is included if needed
Attachment 314711 [details] pushed as b61dcb1 - Include config.h if needed in the files that do not include it yet
Comment 44 Ignacio Casal Quinteiro (nacho) 2015-11-04 19:13:43 UTC
Comment on attachment 314702 [details] [review]
Use the proper glib version macros

Attachment 314702 [details] pushed as fd08165 - Use the proper glib version macros
Comment 45 Ignacio Casal Quinteiro (nacho) 2015-11-09 08:57:35 UTC
Attachment 314204 [details] pushed as e849cc1 - Properly handle the visibility of the methods
Attachment 314410 [details] pushed as 30bd9de - Mark soup_message_io_cleanup as available
Attachment 314706 [details] pushed as 903e5fd - Provide a _SOUP_EXTERN so we ensure the methods get externalized
Attachment 314707 [details] pushed as e4572a7 - Declare a SOUP_VAR to externalize variables
Comment 46 Ignacio Casal Quinteiro (nacho) 2015-11-09 09:00:01 UTC
At this point we are just missing the deprecation patch that we need for figure out a good way to fix the unit tests.
Comment 47 Dan Winship 2015-11-22 16:36:09 UTC
Created attachment 316049 [details] [review]
Mark old session-(async|sync) methods as deprecated

They were not marked as deprecated yet to give people time to port over
without getting annoying warnings. Now that we are at the start
of a cycle let's mark them.
Fix all the consequent deprecation warnings.

======

Is this OK for you?
Comment 48 Ignacio Casal Quinteiro (nacho) 2015-11-23 09:10:54 UTC
Review of attachment 316049 [details] [review]:

The patch seems fine for me.
Comment 49 Paolo Borelli 2015-11-23 09:47:21 UTC
We will need to test that inline trick in VS, but it should be ok.


What about undefining IS_(A)SYNC_SESSION and redefining it to the undeprecated version only in a private header or only if a special "inside libsoup" flag is defined? This way library users would still get the deprecation warning.
Comment 50 Dan Winship 2015-11-23 14:13:15 UTC
(In reply to Paolo Borelli from comment #49)
> What about undefining IS_(A)SYNC_SESSION and redefining it to the
> undeprecated version only in a private header or only if a special "inside
> libsoup" flag is defined? This way library users would still get the
> deprecation warning.

They'll always get a deprecation warning if they *create* a SoupSessionAsync or SoupSessionSync (since the _new and _get_type methods are all still marked deprecated). There is, possibly, a use case for deprecating the _IS_ macros too, but I think the convenience of not doing it outweighs that.
Comment 51 Dan Winship 2015-11-24 14:53:59 UTC
Attachment 316049 [details] pushed as 9aaa13a - Mark old session-(async|sync) methods as deprecated