* 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.
+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
+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
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 *
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;
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);
extern void init_flag_table_gcc_internal (void);
-extern DLL_VARIABLE struct literalstring_parser literalstring_c;
+extern struct literalstring_parser literalstring_c;
#ifdef __cplusplus
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);
{
arglist_parser_remember_literal (ap, argnum, string, context,
file_name, line_number,
- comment, 0);
+ comment, LET_NONE);
}
bool
enum literalstring_escape_type
{
+ LET_NONE = 0,
LET_ANSI_C = 1 << 0,
LET_UNICODE = 1 << 1
};
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)
VARIABLE(input_format_properties)
VARIABLE(input_format_stringtable)
VARIABLE(less_than)
-VARIABLE(line_comment)
VARIABLE(more_than)
VARIABLE(msgcomm_mode)
VARIABLE(omit_header)
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)