summaryrefslogtreecommitdiff
path: root/gtk/gtkimmodule.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2001-11-03 23:26:03 +0000
committerTor Lillqvist <tml@src.gnome.org>2001-11-03 23:26:03 +0000
commitd36c54b4a8fc21f8196b06a9eef0570bbf2bf6fe (patch)
treeaf6faad11c78f19d71204950376d8659094f43a8 /gtk/gtkimmodule.c
parentac812521613047bff5cbe8b74529aafd094be0b6 (diff)
downloadgtk+-d36c54b4a8fc21f8196b06a9eef0570bbf2bf6fe.tar.gz
Can't include gtkprivate.h (I added the include yesterday, without really
2001-11-04 Tor Lillqvist <tml@iki.fi> * gtk/gtkimmodule.c: Can't include gtkprivate.h (I added the include yesterday, without really thinking), as that defeats the working of correct_libdir_prefix() (it becomes a no-op.). Add comment mentioning that. Thanks to Hans Breuer for noticing.
Diffstat (limited to 'gtk/gtkimmodule.c')
-rw-r--r--gtk/gtkimmodule.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/gtk/gtkimmodule.c b/gtk/gtkimmodule.c
index 1be18f554d..85f1c927ca 100644
--- a/gtk/gtkimmodule.c
+++ b/gtk/gtkimmodule.c
@@ -33,11 +33,15 @@
#include <pango/pango-utils.h>
#include "gtkimmodule.h"
#include "gtkimcontextsimple.h"
-#include "gtkprivate.h"
#include "gtkrc.h"
#include "config.h"
#include "gtkintl.h"
+/* Do *not* include "gtkprivate.h" in this file. If you do, the
+ * correct_libdir_prefix() function below will have to move somewhere
+ * else.
+ */
+
#define SIMPLE_ID "gtk-im-context-simple"
typedef struct _GtkIMModule GtkIMModule;
@@ -223,10 +227,20 @@ add_module (GtkIMModule *module, GSList *infos)
modules_list = g_slist_prepend (modules_list, module);
}
-#ifdef G_OS_WIN32
+#if defined (G_OS_WIN32) && defined (GTK_LIBDIR)
+/* This is needes on Win32, but not wanted when compiling with MSVC,
+ * as the makefile.msc doesn't define any GTK_LIBDIR value.
+ */
+
+#define DO_CORRECT_LIBDIR_PREFIX /* Flag to check below whether to call this */
+
static void
correct_libdir_prefix (gchar **path)
{
+ /* GTK_LIBDIR here is supposed to still have the definition from
+ * Makefile.am, i.e. the build-time value. Do *not* include gtkprivate.h
+ * in this file.
+ */
if (strncmp (*path, GTK_LIBDIR, strlen (GTK_LIBDIR)) == 0)
{
/* This is an entry put there by make install on the
@@ -237,8 +251,9 @@ correct_libdir_prefix (gchar **path)
* builder's machine. Replace the path with the real
* one on this machine.
*/
+ extern const gchar *_gtk_get_libdir ();
gchar *tem = *path;
- *path = g_strconcat (GTK_LIBDIR, tem + strlen (GTK_LIBDIR), NULL);
+ *path = g_strconcat (_gtk_get_libdir (), tem + strlen (GTK_LIBDIR), NULL);
g_free (tem);
}
}
@@ -303,7 +318,7 @@ gtk_im_module_init ()
}
module->path = g_strdup (tmp_buf->str);
-#ifdef G_OS_WIN32
+#ifdef DO_CORRECT_LIBDIR_PREFIX
correct_libdir_prefix (&module->path);
#endif
g_type_module_set_name (G_TYPE_MODULE (module), module->path);
@@ -329,7 +344,7 @@ gtk_im_module_init ()
if (!pango_scan_string (&p, tmp_buf))
goto context_error;
info->domain_dirname = g_strdup (tmp_buf->str);
-#ifdef G_OS_WIN32
+#ifdef DO_CORRECT_LIBDIR_PREFIX
correct_libdir_prefix (&info->domain_dirname);
#endif