]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Remove the parentheses around the expansions of N_ and gettext_noop.
authorBruno Haible <bruno@clisp.org>
Tue, 15 Jan 2002 13:00:46 +0000 (13:00 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 23:00:20 +0000 (01:00 +0200)
doc/ChangeLog
doc/gettext.texi
lib/ChangeLog
lib/gettext.h

index 677f32de42e8e65fc19d7ac719f5c8b17d316eda..232cf12fdb7a9919fe35a3f6fbe5e8f9f81bdb7e 100644 (file)
@@ -1,3 +1,8 @@
+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.
index c863bdf9e47926aeb92c9bf98b4eb49039c57e07..43cff90b19e6278d205db29beed4c07f29666956 100644 (file)
@@ -704,7 +704,7 @@ or in a central header file:
 @example
 @group
 #define _(String) (String)
-#define N_(String) (String)
+#define N_(String) String
 #define textdomain(Domain)
 #define bindtextdomain(Package, Directory)
 @end group
@@ -719,7 +719,7 @@ simply replace these definitions by the following:
 @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
@@ -1858,7 +1858,7 @@ from the array.  So one solution can look like this:
 
 @example
 @group
-#define gettext_noop(String) (String)
+#define gettext_noop(String) String
 
 @{
   static const char *messages[] = @{
@@ -1886,7 +1886,7 @@ with the following one:
 
 @example
 @group
-#define gettext_noop(String) (String)
+#define gettext_noop(String) String
 
 @{
   static const char *messages[] = @{
@@ -1904,11 +1904,9 @@ with the following one:
 @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
@@ -4230,7 +4228,7 @@ The same procedure can be done for the @code{gettext_noop} invocations
 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
 
index 02ab0a59213b58b80f4b64f14fc673d2ce97cf32..1ff942de5268bbfdc27ca74201adf74f495575b6 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 9a67f2d373e7c1b2cedfe334068491c50628ca8a..ea67f30815abb41c798ec330486e89752c1803c5 100644 (file)
@@ -1,5 +1,5 @@
 /* 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 */