[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gEDA-dev: gschem does not compile with --disable-nls



	Hi,

as the title says, gschem can no more be built with --disable-nls.
The reason is that getttext() is a macro taking one parameter that
does not work in a context where a function pointer casted to
GtkTranslateFunc is expected. I have fixed it with the appended 
patch, which also removes the cast since gettext_fn is defined
with the proper parameters. 

The patch also changes help_string from a char * variable to a 
const char * to silence a compiler warning.

	Regards,
	Gabriel

Index: gschem/src/x_menus.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_menus.c,v
retrieving revision 1.36
diff -u -r1.36 x_menus.c
--- gschem/src/x_menus.c	15 Jul 2006 18:51:41 -0000	1.36
+++ gschem/src/x_menus.c	24 Jul 2006 10:25:20 -0000
@@ -102,7 +102,7 @@
   char *menu_item_hotkey_func;
   char *menu_item_keys;
   char *spaces;
-  char *help_string;
+  const char *help_string;
   int i, j;
   int name_len, key_len, pad;
   int sum, diff, max_size, space_size;
@@ -264,6 +264,12 @@
  *  \par Function Description
  *
  */
+static gchar* gettext_fn(const gchar *path,
+			 gpointer func_data __attribute__((unused)))
+{
+	return gettext(path);
+}
+
 GtkWidget *get_main_popup(TOPLEVEL *w_current)
 {
   static GtkItemFactory *item_factory;
@@ -281,7 +287,7 @@
   item_factory = gtk_item_factory_new(GTK_TYPE_MENU, "<popup>",
                                       accel_group);
   gtk_item_factory_set_translate_func (item_factory,
-                                       (GtkTranslateFunc)gettext,
+                                       gettext_fn,
                                        NULL, NULL);
   /* This function creates the pop-up menu itself & attaches it to the
      GtkItemFactory. Pass the item factory,


_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev