Re: glademm 2.5: Why does non-NLS version undefine gettext() etc?
- From: Toralf Lund <toralf procaptura com>
- To: GTK-- Mailing List <gtkmm-list gnome org>
- Subject: Re: glademm 2.5: Why does non-NLS version undefine gettext() etc?
- Date: Thu, 25 Nov 2004 22:05:00 +0100
Murray Cumming wrote:
There is a glademm mailing list. This is not it. However, libglademm
would be on topic here.
Is there, now? I haven't worked much with gtkmm/glademm lately (I've
been doing lots of embedded development, among other things...), and
last time I did, this was the only place to ask...
Sorry.
Urgh. There are too many mailing lists in this world...
On Thu, 2004-11-25 at 16:16 +0100, Toralf Lund wrote:
From a glademm-2.5 generated source code file:
#ifdef ENABLE_NLS
# include <libintl.h>
# undef _
# define _(String) dgettext (GETTEXT_PACKAGE, String)
# ifdef gettext_noop
# define N_(String) gettext_noop (String)
# else
# define N_(String) (String)
# endif
#else
# define textdomain(String) (String)
# define gettext(String) (String)
# define dgettext(Domain,Message) (Message)
# define dcgettext(Domain,Message,Type) (Message)
# define bindtextdomain(Domain,Directory) (Domain)
# define _(String) (String)
# define N_(String) (String)
#endif
Why does the #else branch do all this? I mean, shouldn't it just define
_() and N_(), and leave gettext() etc. alone? Isn't the point of using
_()/_N() precisely to avoid overriding the "gettext" calls themselves?
The above construction leads to a compilation error if you don't define
ENABLE_NLS, but happen to include libintl.h anyway - like this:
/usr/include/libintl.h:40: parse error before `__const'
/usr/include/libintl.h:44: parse error before `__const'
/usr/include/libintl.h:51: parse error before `__const'
/usr/include/libintl.h:81: parse error before `__const'
/usr/include/libintl.h:85: parse error before `__const'
which is due to the fact that the function prototypes will be changed by
macro expansion, so that e.g.
extern char *gettext (__const char *__msgid) __THROW;
becomes
extern char *(__const char *__msgid) throw ();
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]