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 660851 - Breakage of code due to changes in the GThread private APIs and other changes
Breakage of code due to changes in the GThread private APIs and other changes
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: build
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-10-04 05:53 UTC by Fan, Chun-wei
Modified: 2012-05-13 04:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Updates due to changes in GThread private API (3.08 KB, patch)
2011-10-04 05:53 UTC, Fan, Chun-wei
none Details | Review
Include gutils.h for use of inline (708 bytes, patch)
2011-10-04 05:55 UTC, Fan, Chun-wei
committed Details | Review
Updates due to changes in GThread private API (3.09 KB, patch)
2011-10-04 05:58 UTC, Fan, Chun-wei
reviewed Details | Review
Updates to gio/gsocket.c (972 bytes, patch)
2011-10-04 15:55 UTC, Fan, Chun-wei
committed Details | Review
Updates to the test programs (2.78 KB, patch)
2011-10-04 15:56 UTC, Fan, Chun-wei
committed Details | Review
Updates to gio/tests/socket-client.c (803 bytes, patch)
2011-10-04 16:47 UTC, Fan, Chun-wei
rejected Details | Review

Description Fan, Chun-wei 2011-10-04 05:53:36 UTC
Created attachment 198184 [details] [review]
Updates due to changes in GThread private API

Hi,

The compilation of GLib, GIO and some of their tests ceased to compile on
Visual C++/Win32 due to the recent changes in the GThread private APIs
(please note that Visual C++ builds define G_DISABLE_DEPRECATED by
default).

The following patch attempts to remedy the situation-there could be more test
programs that are affected by this change.

Thanks, and God bless!
Comment 1 Fan, Chun-wei 2011-10-04 05:55:17 UTC
Created attachment 198186 [details] [review]
Include gutils.h for use of inline

Hi,

Plus, since we are having an inline function in here, I think we need to
include gutils.h as inline may not be universally defined for all compilers
without that header.

Thanks, and God bless!
Comment 2 Fan, Chun-wei 2011-10-04 05:58:20 UTC
Created attachment 198187 [details] [review]
Updates due to changes in GThread private API

Sorry, noticed a small code-styling problem...
Comment 3 Colin Walters 2011-10-04 13:20:28 UTC
Review of attachment 198186 [details] [review]:

Sure.
Comment 4 Colin Walters 2011-10-04 13:53:33 UTC
Review of attachment 198187 [details] [review]:

::: gio/gsocket.c
@@ +218,3 @@
   return g_strerror (err);
 #else
+  static GPrivate last_msg;

This still needs to be initialized with G_PRIVATE_INIT I believe.
Comment 5 Dan Winship 2011-10-04 14:05:48 UTC
(In reply to comment #4)
> This still needs to be initialized with G_PRIVATE_INIT I believe.

though we should probably just change that code to use interned strings rather than GPrivate, like in bug 660849
Comment 6 Fan, Chun-wei 2011-10-04 15:14:43 UTC
Review of attachment 198186 [details] [review]:

Committed as e03db427.

Thank you, and God bless!
Comment 7 Fan, Chun-wei 2011-10-04 15:55:11 UTC
Created attachment 198228 [details] [review]
Updates to gio/gsocket.c

Hi,

I have decided to split this other patch in two parts, one for gio/gsocket.c
and the other for the test programs.  The file attached here is for
gio/gsocket.c-I hope I have understood you correctly, Dan.

The patch for the test programs will follow shortly

Thank you, and God bless!
Comment 8 Fan, Chun-wei 2011-10-04 15:56:25 UTC
Created attachment 198229 [details] [review]
Updates to the test programs

There may well be more code that will need to be updated, but anyways... so
that things will build under Visual C++.

Thank you, and God bless!
Comment 9 Dan Winship 2011-10-04 16:20:14 UTC
Comment on attachment 198228 [details] [review]
Updates to gio/gsocket.c

>gsocket.c: Use intern string instead of GStaticPrivate/
>           g_static_private_set, which were deprecated, as Dan suggested.

GStaticPrivate isn't deprecated, it's just that the API had changed a bit. The change to use interned strings is just because that's a nicer way of doing it.

>+  const char* msg_ret;

the "*" should be attached to "msg_ret", not "char"

Otherwise good to commit, assuming it works. Eg, "./socket-client localhost" in gio/tests should print something along the lines of

    ** Message: Connection to 127.0.0.1:7777 failed: Error connecting: Connection refused, trying next

and... uh... then crash because of a bug in the test program. oops...
Comment 10 Fan, Chun-wei 2011-10-04 16:47:00 UTC
Created attachment 198231 [details] [review]
Updates to gio/tests/socket-client.c

Hi,

It seems also that g_thread_create needs to be converted to g_thread_new as
well here.

Thanks, and God bless!
Comment 11 Fan, Chun-wei 2011-10-04 16:48:42 UTC
Review of attachment 198228 [details] [review]:

This was committed after shifting the * to stick with msg_ret, and the socket-client test program produced output as Dan mentioned.

Thanks, and God bless!
Comment 12 Matthias Clasen 2012-05-13 04:47:33 UTC
Review of attachment 198231 [details] [review]:

This has already been fixed
Comment 13 Matthias Clasen 2012-05-13 04:48:20 UTC
Review of attachment 198229 [details] [review]:

The socket part had already  been fixed, I've committed the rest