+2002-01-12 Bruno Haible <bruno@clisp.org>
+
+ * gettext.texi: Remove the parentheses around the expansions of N_ and
+ gettext_noop.
+
2002-01-14 Bruno Haible <bruno@clisp.org>
* gettext.texi (c-format): Slight reformulation.
@example
@group
#define _(String) (String)
-#define N_(String) (String)
+#define N_(String) String
#define textdomain(Domain)
#define bindtextdomain(Package, Directory)
@end group
@group
#include <libintl.h>
#define _(String) gettext (String)
-#define gettext_noop(String) (String)
+#define gettext_noop(String) String
#define N_(String) gettext_noop (String)
@end group
@end example
@example
@group
-#define gettext_noop(String) (String)
+#define gettext_noop(String) String
@{
static const char *messages[] = @{
@example
@group
-#define gettext_noop(String) (String)
+#define gettext_noop(String) String
@{
static const char *messages[] = @{
@end group
@end example
-But this has some drawbacks. First the programmer has to take care that
+But this has a drawback. The programmer has to take care that
he uses @code{gettext_noop} for the string @code{"a default message"}.
A use of @code{gettext} could have in rare cases unpredictable results.
-The second reason is found in the internals of the GNU @code{gettext}
-Library which will make this solution less efficient.
One advantage is that you need not make control flow analysis to make
sure the output is really translated in any case. But this analysis is
no-op macro. So you should consider the following code for your project:
@example
-#define gettext_noop(String) (String)
+#define gettext_noop(String) String
#define N_(String) gettext_noop (String)
@end example
+2002-01-12 Bruno Haible <bruno@clisp.org>
+
+ * gettext.h (gettext_noop): Remove the parentheses around the
+ expansion.
+
2002-01-10 Bruno Haible <bruno@clisp.org>
* liballoca.h: Fix typo.
/* Convenience header for conditional use of GNU <libintl.h>.
- Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
#endif
-/* For automatical extraction of messages sometimes no real
- translation is needed. Instead the string itself is the result. */
-#define gettext_noop(Str) (Str)
+/* A pseudo function call that serves as a marker for the automated
+ extraction of messages, but does not call gettext(). The run-time
+ translation is done at a different place in the code.
+ The argument, String, should be a literal string. Concatenated strings
+ and other string expressions won't work.
+ The macro's expansion is not parenthesized, so that it is suitable as
+ initializer for static 'char[]' or 'const char[]' variables. */
+#define gettext_noop(String) String
#endif /* _LIBGETTEXT_H */