Hi Kazunobu, 2017-1-9(Mon) 15:53:36 UTC+9 Kazunobu Kuriyama: > 2017-01-09 12:27 GMT+09:00 h_east <h.eas...@gmail.com>: > > > Hi Bram and list, > > > > A build error has occurred with the following configure on Fedora 23. > > > > $ make distclean > > $ ./configure --with-features=small --enable-gui=gnome2 > --enable-fail-if-missing > > $ make > > > > In file included from gui_gtk.c:34:0: > > /usr/include/libintl.h:61:14: error: expected identifier or '(' before > 'unsigned' > > extern char *ngettext (const char *__msgid1, const char *__msgid2, > > ^ > > vim.h:606:35: error: expected ')' before '==' token > > # define ngettext(x, xs, n) (((n) == 1) ? (char *)(x) : (char *)(xs)) > > ^ > > vim.h:606:41: error: expected ')' before '?' token > > # define ngettext(x, xs, n) (((n) == 1) ? (char *)(x) : (char *)(xs)) > > ^ > > Makefile:2971: recipe for target 'objects/gui_gtk.o' failed > > make[1]: *** [objects/gui_gtk.o] Error 1 > > make[1]: Leaving directory '/home/h_east/samba/github/vim/src' > > Makefile:26: recipe for target 'first' failed > > make: *** [first] Error 2 > > > > > > I wrote a patch. But I don't know this patch is correct... > > > > I'm afraid the proposed patch is a sort of overkill, because FEAT_GUI_GTK is > broader than FEAT_GUI_GNOME. > > > So, let me explain another way to fix the issue. > > > With the small build, FEAT_GETTEXT is kept undefined (feature.h:607--613), > and hence Vim is supposed not to include libintl.h; instead, Vim defines > ngettext() and other libintl macros such as _() and N_() for itself > (vim.h:584--619). > > > > Meanwhile, when the gnome2 feature is enabled, gui_gtk.c includes gnome.h at > line 72, and, as written in the comment at gui_gtk.c:50, gnome.h is said to > redefine some libintl macros. > > > Seeing the error message, I guess gnome.h also redefines ngettext(). > > > Therefore, I think following the way gui_gtk.c:49--73 does could give another > solution to the issue, namely, > > > > diff --git a/src/gui_gtk.c b/src/gui_gtk.c > index 8686381b0..c015d7ee6 100644 > --- a/src/gui_gtk.c > +++ b/src/gui_gtk.c > @@ -51,6 +51,9 @@ > # ifdef _ > # undef _ > # endif > +# ifdef ngettext > +# undef ngettext > +# endif > # ifdef N_ > # undef N_ > # endif
Thank you for the polite explanation! Your suggested way cleared this problem. In fact, I also made the same fix for gui_gtk_x11.c. Patch attached. Thanks again👍 -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
diff --git a/src/gui_gtk.c b/src/gui_gtk.c index 8686381..c015d7e 100644 --- a/src/gui_gtk.c +++ b/src/gui_gtk.c @@ -51,6 +51,9 @@ # ifdef _ # undef _ # endif +# ifdef ngettext +# undef ngettext +# endif # ifdef N_ # undef N_ # endif diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 514ac9e..71bcd6a 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -35,6 +35,9 @@ # ifdef _ # undef _ # endif +# ifdef ngettext +# undef ngettext +# endif # ifdef N_ # undef N_ # endif