Bug 45742 - Dont use deprecated function from glib on win32
Summary: Dont use deprecated function from glib on win32
Status: RESOLVED FIXED
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: Other Windows (All)
: medium normal
Assignee: Dan Nicholson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-07 06:53 UTC by Maarten Bosmans
Modified: 2012-05-21 21:10 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
proposed patch (650 bytes, patch)
2012-02-07 06:53 UTC, Maarten Bosmans
Details | Splinter Review

Description Maarten Bosmans 2012-02-07 06:53:18 UTC
Created attachment 56712 [details] [review]
proposed patch

g_win32_get_package_installation_subdirectory() has been deprecated since GLib 2.18 and in recent (2.31) GLib versions disabled entirely by default. This patch replaces usage of that function by g_win32_get_package_installation_directory_of_module() and g_build_filename().

g_win32_get_package_installation_directory_of_module is supported since GLib 2.16. Perhaps the minimal GLib version in the configure.ac PKG_CHECK macro should be changed accordingly?
Comment 1 Dan Nicholson 2012-05-14 09:13:43 UTC
Comment on attachment 56712 [details] [review]
proposed patch

Review of attachment 56712 [details] [review]:
-----------------------------------------------------------------

Looks like this introduces a leak, but we already were leaking from g_win32_get_package_installation_directory, so I guess this isn't really much worse. Can you test with the change suggested below?

::: pkg.h.old
@@ +27,4 @@
>  /* It's OK to leak this */
>  #undef PKG_CONFIG_PC_PATH
>  #define PKG_CONFIG_PC_PATH \
> +  g_strconcat (g_build_filename (g_win32_get_package_installation_directory_of_module (NULL), "lib/pkgconfig"), \

The documentation on g_build_filename says the argument list must end in NULL, so it looks like we need a NULL after "lib/pkgconfig".

http://developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-build-filename

Also, since we're using g_build_filename, we might as well split "lib" and "pkgconfig" into separate args so we ensure the appropriate directory separator is used.

Same comments apply below.
Comment 2 Dan Nicholson 2012-05-21 21:10:50 UTC
This one got fixed a little differently in commit 7ac6f32 and got some confirmation to work on msys.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.