GNOME Bugzilla – Bug 711049
Fix build of GLib-GIO 2.39.x on Windows/MSVC
Last modified: 2013-11-07 01:28:37 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...
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...
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 on attachment 258410 [details] [review] codegen.py: Avoid #ifdef check in a macro use/definition seems fine to me
Review of attachment 258408 [details] [review]: Hello The patch was pushed as 61e8e1cd. With blessings, thanks for the review!
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!
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!
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!