summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2014-05-12 15:18:38 +0900
committerDaiki Ueno <ueno@gnu.org>2014-05-12 15:29:22 +0900
commit0d334ae2924f898a2856ace4f1ef44e3fc8c9d5a (patch)
tree6c6e5265dc98a1c092957978ab153d62ee669ece
parent1a68f7d230fa82ad98d53520032779e323a27b5a (diff)
downloadexternal_gettext-0d334ae2924f898a2856ace4f1ef44e3fc8c9d5a.zip
external_gettext-0d334ae2924f898a2856ace4f1ef44e3fc8c9d5a.tar.gz
external_gettext-0d334ae2924f898a2856ace4f1ef44e3fc8c9d5a.tar.bz2
build: Fix Woe32 cross build
* msgfmt.c (add_languages): New function split from get_languages. (get_languages): Use add_languages instead of manually parsing LINGUAS envvar with strtok_r possibly provided by libgettextlib. * x-c.h (literalstring_c): Remove unnecessary DLL_VARIABLE. * xgettext.c (arglist_parser_alloc): Use LET_NONE instead of 0. (arglist_parser_remember): Likewise. * xgettext.h (enum literalstring_escape_type): New enum value LET_NONE. * woe32dll/gettextsrc-exports.c: Don't export line_comment and po_lex_iconv if undefined.
-rw-r--r--gettext-tools/ChangeLog6
-rw-r--r--gettext-tools/src/ChangeLog12
-rw-r--r--gettext-tools/src/msgfmt.c56
-rw-r--r--gettext-tools/src/x-c.h2
-rw-r--r--gettext-tools/src/xgettext.c8
-rw-r--r--gettext-tools/src/xgettext.h1
-rw-r--r--gettext-tools/woe32dll/gettextsrc-exports.c7
7 files changed, 56 insertions, 36 deletions
diff --git a/gettext-tools/ChangeLog b/gettext-tools/ChangeLog
index d1a8783..c806aa7 100644
--- a/gettext-tools/ChangeLog
+++ b/gettext-tools/ChangeLog
@@ -1,3 +1,9 @@
+2014-05-12 Daiki Ueno <ueno@gnu.org>
+
+ build: Fix Woe32 cross build
+ * woe32dll/gettextsrc-exports.c: Don't export line_comment and
+ po_lex_iconv if undefined.
+
2014-04-22 Daiki Ueno <ueno@gnu.org>
build: Use git-version-gen intead of version.sh
diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog
index ddf70f3..6f662a4 100644
--- a/gettext-tools/src/ChangeLog
+++ b/gettext-tools/src/ChangeLog
@@ -1,3 +1,15 @@
+2014-05-12 Daiki Ueno <ueno@gnu.org>
+
+ * msgfmt.c (add_languages): New function split from get_languages.
+ (get_languages): Use add_languages instead of manually parsing
+ LINGUAS envvar with strtok_r.
+
+ * x-c.h (literalstring_c): Remove unnecessary DLL_VARIABLE.
+ * xgettext.c (arglist_parser_alloc): Use LET_NONE instead of 0.
+ (arglist_parser_remember): Likewise.
+ * xgettext.h (enum literalstring_escape_type): New enum value
+ LET_NONE.
+
2014-05-10 Guido Flohr <guido@imperia.net>
msgattrib: Add --empty option to clear msgstr
diff --git a/gettext-tools/src/msgfmt.c b/gettext-tools/src/msgfmt.c
index 5a5184d..2a0c6cc 100644
--- a/gettext-tools/src/msgfmt.c
+++ b/gettext-tools/src/msgfmt.c
@@ -1268,6 +1268,30 @@ read_catalog_file_msgfmt (char *filename, catalog_input_format_ty input_syntax)
fclose (fp);
}
+static void
+add_languages (string_list_ty *languages, const char *line, size_t length)
+{
+ char *start;
+
+ /* Split the line by whitespace and build the languages list. */
+ for (start = (char *) line; start - line < length; )
+ {
+ char *p;
+
+ /* Skip whitespace before the string. */
+ while (*start == ' ' || *start == '\t')
+ start++;
+
+ p = start;
+ while (*p != '\0' && *p != ' ' && *p != '\t')
+ p++;
+
+ *p = '\0';
+ string_list_append_unique (languages, start);
+ start = p + 1;
+ }
+}
+
/* Compute the languages list by reading the "LINGUAS" envvar or the
LINGUAS file under DIRECTORY. */
static string_list_ty *
@@ -1279,19 +1303,7 @@ get_languages (const char *directory)
languages = string_list_alloc ();
envval = getenv ("LINGUAS");
if (envval)
- {
- char *saveptr;
- for (; ; envval = NULL)
- {
- char *language = strtok_r (envval, " \t", &saveptr);
-
- if (!language)
- break;
-
- string_list_append_unique (languages, language);
- free (language);
- }
- }
+ add_languages (languages, envval, strlen (envval));
else
{
char *linguas_file_name;
@@ -1344,23 +1356,7 @@ get_languages (const char *directory)
if (*line_buf == '\0' || *line_buf == '#')
continue;
- /* Split the line by whitespace and build the languages list. */
- for (start = line_buf; start - line_buf < len; )
- {
- char *p;
-
- /* Skip whitespace before the string. */
- while (*start == ' ' || *start == '\t')
- start++;
-
- p = start;
- while (*p != '\0' && *p != ' ' && *p != '\t')
- p++;
-
- *p = '\0';
- string_list_append_unique (languages, start);
- start = p + 1;
- }
+ add_languages (languages, line_buf, len);
}
free (line_buf);
diff --git a/gettext-tools/src/x-c.h b/gettext-tools/src/x-c.h
index 85a3141..64e4953 100644
--- a/gettext-tools/src/x-c.h
+++ b/gettext-tools/src/x-c.h
@@ -84,7 +84,7 @@ extern void init_flag_table_objc (void);
extern void init_flag_table_gcc_internal (void);
-extern DLL_VARIABLE struct literalstring_parser literalstring_c;
+extern struct literalstring_parser literalstring_c;
#ifdef __cplusplus
diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c
index 891613e..eb3a660 100644
--- a/gettext-tools/src/xgettext.c
+++ b/gettext-tools/src/xgettext.c
@@ -2684,17 +2684,17 @@ arglist_parser_alloc (message_list_ty *mlp, const struct callshapes *shapes)
ap->alternative[i].argtotal = shapes->shapes[i].argtotal;
ap->alternative[i].xcomments = shapes->shapes[i].xcomments;
ap->alternative[i].msgctxt = NULL;
- ap->alternative[i].msgctxt_escape = 0;
+ ap->alternative[i].msgctxt_escape = LET_NONE;
ap->alternative[i].msgctxt_pos.file_name = NULL;
ap->alternative[i].msgctxt_pos.line_number = (size_t)(-1);
ap->alternative[i].msgid = NULL;
- ap->alternative[i].msgid_escape = 0;
+ ap->alternative[i].msgid_escape = LET_NONE;
ap->alternative[i].msgid_context = null_context;
ap->alternative[i].msgid_pos.file_name = NULL;
ap->alternative[i].msgid_pos.line_number = (size_t)(-1);
ap->alternative[i].msgid_comment = NULL;
ap->alternative[i].msgid_plural = NULL;
- ap->alternative[i].msgid_plural_escape = 0;
+ ap->alternative[i].msgid_plural_escape = LET_NONE;
ap->alternative[i].msgid_plural_context = null_context;
ap->alternative[i].msgid_plural_pos.file_name = NULL;
ap->alternative[i].msgid_plural_pos.line_number = (size_t)(-1);
@@ -2819,7 +2819,7 @@ arglist_parser_remember (struct arglist_parser *ap,
{
arglist_parser_remember_literal (ap, argnum, string, context,
file_name, line_number,
- comment, 0);
+ comment, LET_NONE);
}
bool
diff --git a/gettext-tools/src/xgettext.h b/gettext-tools/src/xgettext.h
index baba1de..c852ae3 100644
--- a/gettext-tools/src/xgettext.h
+++ b/gettext-tools/src/xgettext.h
@@ -251,6 +251,7 @@ extern refcounted_string_list_ty *
enum literalstring_escape_type
{
+ LET_NONE = 0,
LET_ANSI_C = 1 << 0,
LET_UNICODE = 1 << 1
};
diff --git a/gettext-tools/woe32dll/gettextsrc-exports.c b/gettext-tools/woe32dll/gettextsrc-exports.c
index d4bf021..fc63e0b 100644
--- a/gettext-tools/woe32dll/gettextsrc-exports.c
+++ b/gettext-tools/woe32dll/gettextsrc-exports.c
@@ -15,6 +15,10 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include "woe32dll/export.h"
VARIABLE(allow_duplicates)
@@ -56,7 +60,6 @@ VARIABLE(input_format_po)
VARIABLE(input_format_properties)
VARIABLE(input_format_stringtable)
VARIABLE(less_than)
-VARIABLE(line_comment)
VARIABLE(more_than)
VARIABLE(msgcomm_mode)
VARIABLE(omit_header)
@@ -72,7 +75,9 @@ VARIABLE(po_error)
VARIABLE(po_error_at_line)
VARIABLE(po_gram_lval)
VARIABLE(po_lex_charset)
+#if HAVE_ICONV
VARIABLE(po_lex_iconv)
+#endif
VARIABLE(po_lex_weird_cjk)
VARIABLE(po_multiline_error)
VARIABLE(po_multiline_warning)