]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
build: Fix Woe32 cross build
authorDaiki Ueno <ueno@gnu.org>
Mon, 12 May 2014 06:18:38 +0000 (15:18 +0900)
committerDaiki Ueno <ueno@gnu.org>
Mon, 12 May 2014 06:29:22 +0000 (15:29 +0900)
* 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.

gettext-tools/ChangeLog
gettext-tools/src/ChangeLog
gettext-tools/src/msgfmt.c
gettext-tools/src/x-c.h
gettext-tools/src/xgettext.c
gettext-tools/src/xgettext.h
gettext-tools/woe32dll/gettextsrc-exports.c

index d1a878307e554370ce23567a69513269af49fe46..c806aa7226be011d5fc1ebf081c0d79f697f665c 100644 (file)
@@ -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
index ddf70f3744d7474c820b94c73e726694c954652e..6f662a44952a2d6bcc15773c2c6c2e6cb162c400 100644 (file)
@@ -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
index 5a5184d595bd933e8be5c254e4f60ede9ca4b590..2a0c6cc38843671dcd0e59dfbcb41b3db494598f 100644 (file)
@@ -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);
index 85a31414fe14fd2e43abce6ea8a29826fe48912d..64e4953ff35269e0b8d2195ad8fc36458a3269f3 100644 (file)
@@ -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
index 891613efa17cbf4d7bb377f3827f54b96b635e57..eb3a6602556cdb28938a600df108ed1e0dbe1207 100644 (file)
@@ -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
index baba1de27b58a0f1dbf3b45b858268aa5dc83d1d..c852ae32e7b4b94b2e77d6563f7f4ad88873dc75 100644 (file)
@@ -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
 };
index d4bf02133efa7cd2ed33e31dd0e648936985695f..fc63e0bde91c189f25769dd1663618f7c8af75e2 100644 (file)
    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)