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 623875 - gstregistrybinary.c compatibility with glib >= 2.25.0
gstregistrybinary.c compatibility with glib >= 2.25.0
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.29
Other Windows
: Normal normal
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-07-08 18:52 UTC by David Hoyt
Modified: 2010-07-16 17:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to use the appropriate glib stat struct for the platform (486 bytes, patch)
2010-07-08 18:52 UTC, David Hoyt
accepted-commit_after_freeze Details | Review
Fixes the warning in other places as well (2.23 KB, patch)
2010-07-08 19:05 UTC, David Hoyt
committed Details | Review

Description David Hoyt 2010-07-08 18:52:31 UTC
Created attachment 165507 [details] [review]
Patch to use the appropriate glib stat struct for the platform

When compiling gst against glib >= 2.25.0 on MSVC, a warning about incompatible pointer types is received.

According to the glib documentation (http://library.gnome.org/devel/glib/unstable/glib-File-Utilities.html#g-stat):

On Windows the Microsoft C libraries have several variants of the stat struct and stat() function with names like "_stat", "_stat32", "_stat32i64" and "_stat64i32". The one used here is for 32-bit code the one with 32-bit size and time fields, specifically called "_stat32". 

In Microsoft's compiler, by default "struct stat" means one with 64-bit time fields while in MinGW "struct stat" is the legacy one with 32-bit fields. To hopefully clear up this messs, the gstdio.h header defines a type GStatBuf which is the appropriate struct type depending on the platform and/or compiler being used. On POSIX it is just "struct stat", but note that even on POSIX platforms, "stat" might be a macro.


The attached patch resolves the issue by using GStatBuf in later versions of glib. The warning subsequently goes away.

I apologize for the format of the patch.
Comment 1 Sebastian Dröge (slomo) 2010-07-08 19:04:19 UTC
Thanks, I'll commit this after the next core release in a few days.
Comment 2 David Hoyt 2010-07-08 19:05:32 UTC
Created attachment 165508 [details] [review]
Fixes the warning in other places as well
Comment 3 Sebastian Dröge (slomo) 2010-07-16 15:35:13 UTC
commit c53457976e00264f0646ad040993ce100aa73e5a
Author: David Hoyt <dhoyt@llnl.gov>
Date:   Thu Jul 8 21:04:54 2010 +0200

    registrybinary: Fix compatibility with GLib 2.25 when using MSVC
    
    Newer GLib uses a new type for g_stat() and friends to improve
    Windows compatibility. On POSIX this is a typedef to struct stat.
    
    Fixes bug #623875.
Comment 4 Tim-Philipp Müller 2010-07-16 17:02:28 UTC
I've also committed this, hope things still work:

 commit b987febf09b17d513cdf26251c71631291a89130
 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
 Date:   Fri Jul 16 17:53:38 2010 +0100

    registry: use GStatBuf unconditionally and add typedef for backwards compatibility
    
    No need to clutter the code with #if #else #endif.
    
    See #623875.