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 711049 - Fix build of GLib-GIO 2.39.x on Windows/MSVC
Fix build of GLib-GIO 2.39.x on Windows/MSVC
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.39.x
Other Windows
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-10-29 06:28 UTC by Fan, Chun-wei
Modified: 2013-11-07 01:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gio/gsubprocess.c: Use g_snprintf() instead of snprintf() (977 bytes, patch)
2013-10-29 06:51 UTC, Fan, Chun-wei
committed Details | Review
codegen.py: Avoid #ifdef check in a macro use/definition (3.07 KB, patch)
2013-10-29 06:57 UTC, Fan, Chun-wei
committed Details | Review

Description Fan, Chun-wei 2013-10-29 06:28:10 UTC
Hi,

There were some changes/additions in GIO that broke the build on Windows/Visual C++, namely:

-The use of snprintf() [I know, not even Visual C++ 2013 has this there, ugh.] in gsubprocess.c

-The check on GLIB_VERSION_MAX_ALLOWED in commit 1b08980b ("gdbus-codegen: Take into consideration MAX_ALLOWED for private data") in gdbus-2.0/codegen.py [I know it's ugly, but Visual Studio does not like #ifdef checks in macro definitions/usage.]

Here are my patches for them...
Comment 1 Fan, Chun-wei 2013-10-29 06:51:09 UTC
Created attachment 258408 [details] [review]
gio/gsubprocess.c: Use g_snprintf() instead of snprintf()

This replaces the call to snprintf() with g_snprintf() as snprintf() is not universally available...
Comment 2 Fan, Chun-wei 2013-10-29 06:57:33 UTC
Created attachment 258410 [details] [review]
codegen.py: Avoid #ifdef check in a macro use/definition

This patch is a bit ugly, but it is unfortunate that compilers like Visual C++ (and possibly others) do not like #ifdef checks when a macro is being defined/used.

Thanks for your time, with blessings!
Comment 3 Dan Winship 2013-10-29 13:54:19 UTC
Comment on attachment 258410 [details] [review]
codegen.py: Avoid #ifdef check in a macro use/definition

seems fine to me
Comment 4 Fan, Chun-wei 2013-10-29 14:45:45 UTC
Review of attachment 258408 [details] [review]:

Hello

The patch was pushed as 61e8e1cd.

With blessings, thanks for the review!
Comment 5 Fan, Chun-wei 2013-11-05 09:53:45 UTC
Hi,

Can I ask someone to look at the patch to codege.py, as it broke building of GLib on Visual C++ due to it creating gdbus-daemon-generated.[ch] in a manner that Visual C++ doesn't like, as mentioned in comment #2.  Would like to get the fix in asap.

With blessings, thank you!
Comment 6 Colin Walters 2013-11-06 21:05:28 UTC
Review of attachment 258410 [details] [review]:

A little unfortunate we have to duplicate the generated code, but not a big deal.  Looks OK to me.  Thanks!
Comment 7 Fan, Chun-wei 2013-11-07 01:28:11 UTC
Review of attachment 258410 [details] [review]:

Hi Colin,

Thanks for the review, the patch was pushed as 87e6db8d.

I will close this bug shortly.

With blessings!