[gdk-pixbuf] Build gdk_pixbuf_get_toplevel() even if !USE_GMODULE
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] Build gdk_pixbuf_get_toplevel() even if !USE_GMODULE
- Date: Sun, 23 Aug 2015 14:39:19 +0000 (UTC)
commit c153b0341fd15c12f1ed8e4058592d80de80158d
Author: Benjamin Gilbert <bgilbert backtick net>
Date: Tue Aug 18 22:54:50 2015 -0400
Build gdk_pixbuf_get_toplevel() even if !USE_GMODULE
a55aa6eb introduced gdk_pixbuf_get_toplevel(), which is called if
GDK_PIXBUF_RELOCATABLE but is only built if USE_GMODULE &&
GDK_PIXBUF_RELOCATABLE. This causes build failures on MinGW and Darwin
when configured with --disable-modules.
https://bugzilla.gnome.org/show_bug.cgi?id=740912
gdk-pixbuf/gdk-pixbuf-io.c | 69 +++++++++++++++++++++++--------------------
1 files changed, 37 insertions(+), 32 deletions(-)
---
diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c
index a805e82..7f086db 100644
--- a/gdk-pixbuf/gdk-pixbuf-io.c
+++ b/gdk-pixbuf/gdk-pixbuf-io.c
@@ -214,6 +214,43 @@ DllMain (HINSTANCE hinstDLL,
#endif
+#ifdef GDK_PIXBUF_RELOCATABLE
+
+gchar *
+gdk_pixbuf_get_toplevel (void)
+{
+ static gchar *toplevel = NULL;
+
+ if (toplevel == NULL) {
+#if defined(G_OS_WIN32)
+ toplevel = g_win32_get_package_installation_directory_of_module (gdk_pixbuf_dll);
+#elif defined(OS_DARWIN)
+ char pathbuf[PATH_MAX + 1];
+ uint32_t bufsize = sizeof(pathbuf);
+ gchar *bin_dir;
+
+ _NSGetExecutablePath(pathbuf, &bufsize);
+ bin_dir = g_dirname(pathbuf);
+ toplevel = g_build_path (G_DIR_SEPARATOR_S, bin_dir, "..", NULL);
+ g_free (bin_dir);
+#elif defined (OS_LINUX)
+ gchar *exe_path, *bin_dir;
+
+ exe_path = g_file_read_link ("/proc/self/exe", NULL);
+ bin_dir = g_dirname(exe_path);
+ toplevel = g_build_path (G_DIR_SEPARATOR_S, bin_dir, "..", NULL);
+ g_free (exe_path);
+ g_free (bin_dir);
+#else
+#error "Relocations not supported for this platform"
+#endif
+ }
+ return toplevel;
+}
+
+#endif /* GDK_PIXBUF_RELOCATABLE */
+
+
#ifdef USE_GMODULE
static gboolean
@@ -297,38 +334,6 @@ skip_space (const char **pos)
#ifdef GDK_PIXBUF_RELOCATABLE
-gchar *
-gdk_pixbuf_get_toplevel (void)
-{
- static gchar *toplevel = NULL;
-
- if (toplevel == NULL) {
-#if defined(G_OS_WIN32)
- toplevel = g_win32_get_package_installation_directory_of_module (gdk_pixbuf_dll);
-#elif defined(OS_DARWIN)
- char pathbuf[PATH_MAX + 1];
- uint32_t bufsize = sizeof(pathbuf);
- gchar *bin_dir;
-
- _NSGetExecutablePath(pathbuf, &bufsize);
- bin_dir = g_dirname(pathbuf);
- toplevel = g_build_path (G_DIR_SEPARATOR_S, bin_dir, "..", NULL);
- g_free (bin_dir);
-#elif defined (OS_LINUX)
- gchar *exe_path, *bin_dir;
-
- exe_path = g_file_read_link ("/proc/self/exe", NULL);
- bin_dir = g_dirname(exe_path);
- toplevel = g_build_path (G_DIR_SEPARATOR_S, bin_dir, "..", NULL);
- g_free (exe_path);
- g_free (bin_dir);
-#else
-#error "Relocations not supported for this platform"
-#endif
- }
- return toplevel;
-}
-
static char *
get_libdir (void)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]