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 684278 - Fix GIO build on Windows
Fix GIO build on Windows
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.33.x
Other Windows
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 684414 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-09-18 09:11 UTC by Fan, Chun-wei
Modified: 2012-09-20 00:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Conditionally process the code using g_content_type_get_symbolic_icon() and g_content_type_get_generic_icon_name() (1.54 KB, patch)
2012-09-18 09:11 UTC, Fan, Chun-wei
committed Details | Review

Description Fan, Chun-wei 2012-09-18 09:11:51 UTC
Created attachment 224583 [details] [review]
Conditionally process the code using g_content_type_get_symbolic_icon() and g_content_type_get_generic_icon_name() 

Hi,

The recent additions of g_content_type_get_symbolic_icon() and g_content_type_get_generic_icon_name() seem to be only for *nix, at least for now, so the unconditional addition of these APIs into gio.symbols broke the build on Windows.  Likewise, gio/glocalfileinfo.c called g_content_type_get_symbolic_icon() unconditionally, which also broke the Windows build.

The attached patch attempts to fix this by guarding them with #ifdef G_OS_UNIX, at least for the time being until the afore-mentioned functions becomes usable for Windows.

With blessings, thank you!
Comment 1 Colin Walters 2012-09-18 21:11:04 UTC
Review of attachment 224583 [details] [review]:

Can you elaborate on "don't seem to be for Windows"?  It looks like we were calling into the xdg_ functions there before, so the new API shouldn't have introduced a regression.  Whether it makes sense to use the XDG stuff on Windows is a separate question...
Comment 2 Colin Walters 2012-09-18 21:11:31 UTC
Basically, what's the build failure on Windows without your patch?
Comment 3 Fan, Chun-wei 2012-09-19 00:17:00 UTC
Hi Colin,

(In reply to comment #1)
> It looks like we were
> calling into the xdg_ functions there before

Well, gcontenttype.c was split up into gcontenttype.c (*nix-where the new functions reside in, from commits cc3238a9c and 40b4fae4) and gcontenttype-win32.c (Windows) in commit 32192ee9 (Split gcontenttype.c), and by looking through gio/Makefile.am, neither the sources in gio/xdgmime/ nor gcontenttype.c is built on Windows, so this is the reason why I believed those functions aren't for Windows.

(In reply to comment #2)
> Basically, what's the build failure on Windows without your patch?

Umm..., gio will fail to link (undefined symbols on the two functions that I've mentioned in the initial bug report).  

The best fix is to try to determine the way the two functions will work (if applicable) on Windows and get that into gcontenttype-win32.c, but before that I guess the best thing is to conditionally compile the code, and/or add a stub/TODO: in gcontenttype-win32.c.

With blessings, and thanks for the notes.
Comment 4 Colin Walters 2012-09-19 02:27:53 UTC
Review of attachment 224583 [details] [review]:

I see, thanks for the explanation.  Looks OK to me.
Comment 5 Fan, Chun-wei 2012-09-19 02:34:14 UTC
Review of attachment 224583 [details] [review]:

This patch is pushed as 3dd65859.

With blessings, thank you!
Comment 6 Colin Walters 2012-09-20 00:35:37 UTC
*** Bug 684414 has been marked as a duplicate of this bug. ***