GNOME Bugzilla – Bug 660851
Breakage of code due to changes in the GThread private APIs and other changes
Last modified: 2012-05-13 04:48:39 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!
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!
Created attachment 198187 [details] [review] Updates due to changes in GThread private API Sorry, noticed a small code-styling problem...
Review of attachment 198186 [details] [review]: Sure.
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.
(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
Review of attachment 198186 [details] [review]: Committed as e03db427. Thank you, and God bless!
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!
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 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...
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!
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!
Review of attachment 198231 [details] [review]: This has already been fixed
Review of attachment 198229 [details] [review]: The socket part had already been fixed, I've committed the rest