+2008-02-13 Jim Meyering <meyering@redhat.com>
+ and Eric Blake <ebb9@byu.net>
+
+ Avoid shadowing warning and compile errors on Linux.
+ * tests/test-quotearg.c [ENABLE_NLS]: Disable <libintl.h>
+ forwarding macros on Linux.
+ (dcgettext): Define a stub, for Linux.
+ (results_g, main): Avoid warnings.
+
2008-02-12 Eric Blake <ebb9@byu.net>
Silence warning in last patch.
#include <string.h>
#if ENABLE_NLS
+/* On Linux, gettext is optionally defined as a forwarding macro,
+ which would cause syntax errors in our definition below. But on
+ platforms that require -lintl, we cannot #undef gettext, since we
+ want to provide the entry point libintl_gettext. So we disable
+ optimizations to avoid the Linux macros. */
+# undef __OPTIMIZE__
# include <libintl.h>
/* These quotes are borrowed from a pt_PT.utf8 translation. */
"", "\0001\0", 3, "simple", " \t\n'\"\033?""?/\\", "a:b"
};
-static struct result_groups results[] = {
+static struct result_groups results_g[] = {
/* literal_quoting_style */
{ { "", "\0""1\0", 3, "simple", " \t\n'\"\033?""?/\\", "a:b" },
{ "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b" },
{
return gettext (str);
}
+
+char *
+dcgettext (char const *d, char const *str, int c)
+{
+ return gettext (str);
+}
#endif /* ENABLE_NLS */
int
-main (int argc, char **argv)
+main ()
{
int i;
for (i = literal_quoting_style; i <= clocale_quoting_style; i++)
{
set_quoting_style (NULL, i);
- compare_strings (use_quotearg_buffer, &results[i].group1);
- compare_strings (use_quotearg, &results[i].group2);
- compare_strings (use_quotearg_colon, &results[i].group3);
+ compare_strings (use_quotearg_buffer, &results_g[i].group1);
+ compare_strings (use_quotearg, &results_g[i].group2);
+ compare_strings (use_quotearg_colon, &results_g[i].group3);
}
#if ENABLE_NLS