From: Akim Demaille <akim@epita.fr>
Date: Fri, 3 Aug 2001 09:38:03 +0000 (+0000)
Subject: * src/complain.c: Adjust strerror_r portability issues.
X-Git-Tag: BISON-1_28b~4
X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/8f13fe33b766c69b10674558003d070aea5da1f2

* src/complain.c: Adjust strerror_r portability issues.
---

diff --git a/ChangeLog b/ChangeLog
index 74ce79a1..f3d5f2e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2001-08-03  Akim Demaille  <akim@epita.fr>
+
+	* src/complain.c: Adjust strerror_r portability issues.
+
 2001-08-03  Akim Demaille  <akim@epita.fr>
 
 	Version 1.28a.
diff --git a/po/de.gmo b/po/de.gmo
index bdcfe394..12bba58d 100644
Binary files a/po/de.gmo and b/po/de.gmo differ
diff --git a/po/de.po b/po/de.po
index 19948f9c..7a0d6adf 100644
--- a/po/de.po
+++ b/po/de.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.25\n"
-"POT-Creation-Date: 2001-08-03 11:05+0200\n"
+"POT-Creation-Date: 2001-08-03 11:38+0200\n"
 "PO-Revision-Date: 1996-10-10 17:54 MET DST\n"
 "Last-Translator: Ulrich Drepper <drepper@gnu.ai.mit.edu>\n"
 "Language-Team: German <de@li.org>\n"
@@ -18,11 +18,15 @@ msgstr ""
 msgid "too many states (max %d)"
 msgstr ""
 
-#: src/complain.c:110
+#: lib/error.c:117 src/complain.c:100
+msgid "Unknown system error"
+msgstr ""
+
+#: src/complain.c:154
 msgid "warning: "
 msgstr ""
 
-#: src/complain.c:198 src/complain.c:239
+#: src/complain.c:242 src/complain.c:283
 #, fuzzy
 msgid "fatal error: "
 msgstr "fataler Fehler: %s\n"
@@ -696,10 +700,6 @@ msgstr ""
 "Reduzierung von %s definiert %d Terminal, %d Nicht-Terminal und %d "
 "Produktionen.\n"
 
-#: lib/error.c:117
-msgid "Unknown system error"
-msgstr ""
-
 #: lib/getopt.c:675
 #, c-format
 msgid "%s: option `%s' is ambiguous\n"
diff --git a/po/es.po b/po/es.po
index 3c81b2b6..82ecae09 100644
--- a/po/es.po
+++ b/po/es.po
@@ -30,7 +30,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: GNU bison 1.25\n"
-"POT-Creation-Date: 2001-08-03 11:05+0200\n"
+"POT-Creation-Date: 2001-08-03 11:38+0200\n"
 "PO-Revision-Date: 1998-09-21 10:19+0200\n"
 "Last-Translator: Nicolás García-Pedrajas <ngarcia-pedrajas@acm.org>\n"
 "Language-Team: Spanish <es@li.org>\n"
@@ -43,7 +43,11 @@ msgstr ""
 msgid "too many states (max %d)"
 msgstr ""
 
-#: src/complain.c:110
+#: lib/error.c:117 src/complain.c:100
+msgid "Unknown system error"
+msgstr ""
+
+#: src/complain.c:154
 msgid "warning: "
 msgstr ""
 
@@ -54,7 +58,7 @@ msgstr ""
 # La verdad es que a mi lo de error fatal me suena fatal
 # ngp
 #
-#: src/complain.c:198 src/complain.c:239
+#: src/complain.c:242 src/complain.c:283
 #, fuzzy
 msgid "fatal error: "
 msgstr "error grave: %s\n"
@@ -807,10 +811,6 @@ msgstr ""
 "la reducción de %s define %d terminal%s, %d no terminal%s, y %d produccion%"
 "s.\n"
 
-#: lib/error.c:117
-msgid "Unknown system error"
-msgstr ""
-
 #: lib/getopt.c:675
 #, c-format
 msgid "%s: option `%s' is ambiguous\n"
diff --git a/po/et.gmo b/po/et.gmo
index 67488eba..5154dc37 100644
Binary files a/po/et.gmo and b/po/et.gmo differ
diff --git a/po/et.po b/po/et.po
index a4e48c41..0893e5f6 100644
--- a/po/et.po
+++ b/po/et.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.25\n"
-"POT-Creation-Date: 2001-08-03 11:05+0200\n"
+"POT-Creation-Date: 2001-08-03 11:38+0200\n"
 "PO-Revision-Date: 2000-04-11 22:19+02:00\n"
 "Last-Translator: Toomas Soome <tsoome@ut.ee>\n"
 "Language-Team: Estonian <et@li.org>\n"
@@ -18,11 +18,15 @@ msgstr ""
 msgid "too many states (max %d)"
 msgstr "liiga palju olekuid (maks %d)"
 
-#: src/complain.c:110
+#: lib/error.c:117 src/complain.c:100
+msgid "Unknown system error"
+msgstr ""
+
+#: src/complain.c:154
 msgid "warning: "
 msgstr ""
 
-#: src/complain.c:198 src/complain.c:239
+#: src/complain.c:242 src/complain.c:283
 #, fuzzy
 msgid "fatal error: "
 msgstr "fataalne viga: %s\n"
@@ -716,10 +720,6 @@ msgstr ""
 "redutseeritud %s defineerib %d terminali%s, %d mitteterminali%s ja %d reeglit"
 "%s.\n"
 
-#: lib/error.c:117
-msgid "Unknown system error"
-msgstr ""
-
 #: lib/getopt.c:675
 #, c-format
 msgid "%s: option `%s' is ambiguous\n"
diff --git a/po/fr.gmo b/po/fr.gmo
index a2c7fdcd..a6bf2611 100644
Binary files a/po/fr.gmo and b/po/fr.gmo differ
diff --git a/po/fr.po b/po/fr.po
index 20edbe42..509a0219 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.25\n"
-"POT-Creation-Date: 2001-08-03 11:05+0200\n"
+"POT-Creation-Date: 2001-08-03 11:38+0200\n"
 "PO-Revision-Date: 1996-03-19 20:05 EST\n"
 "Last-Translator: Dominique Boucher <boucherd@IRO.UMontreal.CA>\n"
 "Language-Team: French <fr@li.org>\n"
@@ -18,11 +18,15 @@ msgstr ""
 msgid "too many states (max %d)"
 msgstr ""
 
-#: src/complain.c:110
+#: lib/error.c:117 src/complain.c:100
+msgid "Unknown system error"
+msgstr ""
+
+#: src/complain.c:154
 msgid "warning: "
 msgstr ""
 
-#: src/complain.c:198 src/complain.c:239
+#: src/complain.c:242 src/complain.c:283
 #, fuzzy
 msgid "fatal error: "
 msgstr "erreur fatale: %s\n"
@@ -700,10 +704,6 @@ msgstr ""
 "la réduction de %s définit %d terminal%s, %d catégorie%s et %d production%"
 "s.\n"
 
-#: lib/error.c:117
-msgid "Unknown system error"
-msgstr ""
-
 #: lib/getopt.c:675
 #, c-format
 msgid "%s: option `%s' is ambiguous\n"
diff --git a/po/ja.gmo b/po/ja.gmo
index 7c9810c1..89746894 100644
Binary files a/po/ja.gmo and b/po/ja.gmo differ
diff --git a/po/ja.po b/po/ja.po
index b99b93bf..15562288 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: GNU bison 1.28\n"
-"POT-Creation-Date: 2001-08-03 11:05+0200\n"
+"POT-Creation-Date: 2001-08-03 11:38+0200\n"
 "PO-Revision-Date: 1999-09-28 21:10+0900\n"
 "Last-Translator: Daisuke Yamashita <yamad@mb.infoweb.ne.jp>\n"
 "Language-Team: Japanese <ja@li.org>\n"
@@ -18,11 +18,15 @@ msgstr ""
 msgid "too many states (max %d)"
 msgstr "%s ¤Î¿ô¤¬Â¿¤¹¤®¤Þ¤¹ (ºÇÂç %d)"
 
-#: src/complain.c:110
+#: lib/error.c:117 src/complain.c:100
+msgid "Unknown system error"
+msgstr ""
+
+#: src/complain.c:154
 msgid "warning: "
 msgstr ""
 
-#: src/complain.c:198 src/complain.c:239
+#: src/complain.c:242 src/complain.c:283
 #, fuzzy
 msgid "fatal error: "
 msgstr "%s: Ã×̿Ū¥¨¥é¡¼: "
@@ -698,10 +702,6 @@ msgstr ""
 "´Ô¸µ¥Õ¥¡¥¤¥ë %s ¤Ç %d ¸Ä¤Î½ªÃ¼»Ò%.0s, %d ¸Ä¤ÎÈó½ªÃ¼»Ò%.0s, %d ¸Ä¤Îµ¬Â§%.0s¤¬"
 "ÄêµÁ¤µ¤ì¤Þ¤·¤¿\n"
 
-#: lib/error.c:117
-msgid "Unknown system error"
-msgstr ""
-
 #: lib/getopt.c:675
 #, c-format
 msgid "%s: option `%s' is ambiguous\n"
diff --git a/po/nl.gmo b/po/nl.gmo
index 0a5e0358..7b444467 100644
Binary files a/po/nl.gmo and b/po/nl.gmo differ
diff --git a/po/nl.po b/po/nl.po
index 94554607..1aec041d 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.25\n"
-"POT-Creation-Date: 2001-08-03 11:05+0200\n"
+"POT-Creation-Date: 2001-08-03 11:38+0200\n"
 "PO-Revision-Date: 1996-08-27 15:34 MET DST\n"
 "Last-Translator: Erick Branderhorst <branderh@debian.org>\n"
 "Language-Team: Dutch <nl@li.org>\n"
@@ -18,11 +18,15 @@ msgstr ""
 msgid "too many states (max %d)"
 msgstr ""
 
-#: src/complain.c:110
+#: lib/error.c:117 src/complain.c:100
+msgid "Unknown system error"
+msgstr ""
+
+#: src/complain.c:154
 msgid "warning: "
 msgstr ""
 
-#: src/complain.c:198 src/complain.c:239
+#: src/complain.c:242 src/complain.c:283
 #, fuzzy
 msgid "fatal error: "
 msgstr "fatale fout: %s\n"
@@ -699,10 +703,6 @@ msgstr ""
 "gereduceerd %s gedefinieerd %d terminal%s, %d nietterminal%s, en %d productie"
 "%s.\n"
 
-#: lib/error.c:117
-msgid "Unknown system error"
-msgstr ""
-
 #: lib/getopt.c:675
 #, c-format
 msgid "%s: option `%s' is ambiguous\n"
diff --git a/po/ru.gmo b/po/ru.gmo
index e0732d1a..34d7ee5a 100644
Binary files a/po/ru.gmo and b/po/ru.gmo differ
diff --git a/po/ru.po b/po/ru.po
index 58fdea56..27adb29b 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.28a\n"
-"POT-Creation-Date: 2001-08-03 11:05+0200\n"
+"POT-Creation-Date: 2001-08-03 11:38+0200\n"
 "PO-Revision-Date: 2000-04-12 13:16+04:00\n"
 "Last-Translator: Dmitry S. Sivachenko <dima@Chg.RU>\n"
 "Language-Team: Russian <ru@li.org>\n"
@@ -18,11 +18,15 @@ msgstr ""
 msgid "too many states (max %d)"
 msgstr "ÓÌÉÛËÏÍ ÍÎÏÇÏ ÓÏÓÔÏÑÎÉÊ (ÍÁËÓÉÍÁÌØÎÏ %d)"
 
-#: src/complain.c:110
+#: lib/error.c:117 src/complain.c:100
+msgid "Unknown system error"
+msgstr ""
+
+#: src/complain.c:154
 msgid "warning: "
 msgstr ""
 
-#: src/complain.c:198 src/complain.c:239
+#: src/complain.c:242 src/complain.c:283
 #, fuzzy
 msgid "fatal error: "
 msgstr "ÏÛÉÂËÁ"
@@ -717,10 +721,6 @@ msgstr ""
 "×Ù×ÅÄÅÎÎÙÊ %s ÏÐÒÅÄÅÌÑÅÔ %d ÔÅÒÍÉÎÁÌÏ×%s, %d ÎÅÔÅÒÍÉÎÁÌÏ×%s, É %d ÐÒÁ×ÉÌ "
 "×Ù×ÏÄÁ%s.\n"
 
-#: lib/error.c:117
-msgid "Unknown system error"
-msgstr ""
-
 #: lib/getopt.c:675
 #, c-format
 msgid "%s: option `%s' is ambiguous\n"
diff --git a/src/complain.c b/src/complain.c
index 35a784ee..b25f0b29 100644
--- a/src/complain.c
+++ b/src/complain.c
@@ -47,18 +47,62 @@ void exit ();
 
 #include "complain.h"
 
+#ifndef HAVE_DECL_STRERROR_R
+"this configure-time declaration test was not run"
+#endif
+#if !HAVE_DECL_STRERROR_R
+char *strerror_r ();
+#endif
+
 #ifndef _
 # define _(String) String
 #endif
 
 #ifdef _LIBC
 /* In the GNU C library, there is a predefined variable for this.  */
+
 # define program_name program_invocation_name
+# include <errno.h>
+
+/* In GNU libc we want do not want to use the common name `error' directly.
+   Instead make it a weak alias.  */
+# define error __error
+# define error_at_line __error_at_line
+
+# ifdef USE_IN_LIBIO
+#  include <libio/iolibio.h>
+#  define fflush(s) _IO_fflush (s)
+# endif
+
 #else /* not _LIBC */
+
 /* The calling program should define program_name and set it to the
    name of the executing program.  */
 extern char *program_name;
-#endif
+
+# ifdef HAVE_STRERROR_R
+#  define __strerror_r strerror_r
+# else
+#  if HAVE_STRERROR
+#   ifndef strerror		/* On some systems, strerror is a macro */
+char *strerror ();
+#   endif
+#  else
+static char *
+private_strerror (errnum)
+     int errnum;
+{
+  extern char *sys_errlist[];
+  extern int sys_nerr;
+
+  if (errnum > 0 && errnum <= sys_nerr)
+    return _(sys_errlist[errnum]);
+  return _("Unknown system error");
+}
+#   define strerror private_strerror
+#  endif /* HAVE_STRERROR */
+# endif	/* HAVE_STRERROR_R */
+#endif	/* not _LIBC */
 
 /* This variable is incremented each time `warn' is called.  */
 unsigned int warn_message_count;