diff options
author | Benjamin Gilbert <bgilbert@backtick.net> | 2015-08-18 22:54:50 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-08-23 10:39:06 -0400 |
commit | c153b0341fd15c12f1ed8e4058592d80de80158d (patch) | |
tree | 753c28a24b11307c9bff1f121ec8c5be96bb57f3 /gdk-pixbuf | |
parent | dd4b061c27dc0865c8f8987d294de6e04b321c18 (diff) | |
download | gdk-pixbuf-c153b0341fd15c12f1ed8e4058592d80de80158d.tar.gz |
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
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | 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 a805e8258..7f086db3f 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) { |