bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17056: dfa.c patch for systems with no locale support


From: Paul Eggert
Subject: bug#17056: dfa.c patch for systems with no locale support
Date: Fri, 21 Mar 2014 11:09:15 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

That's odd, as DJGPP has <locale.h> which is supposed to declare setlocale and define LC_ALL, according to <http://www.delorie.com/djgpp/doc/libc/libc_705.html>. Could you explain what goes wrong?

Does the following patch fix the problem? It should isolate the issue better.

diff --git a/src/dfa.c b/src/dfa.c
index 5e60cd5..92ac1b9 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -34,7 +34,11 @@
 #include <locale.h>
 #include <stdbool.h>

-/* Gawk doesn't use Gnulib, so don't assume static_assert is present.  */
+/* Gawk doesn't use Gnulib, so don't assume that setlocale and
+   static_assert are present.  */
+#ifndef LC_ALL
+# define setlocale(category, locale) NULL
+#endif
 #ifndef static_assert
 # define static_assert(cond, diagnostic) \
extern int (*foo (void)) [!!sizeof (struct { int foo: (cond) ? 8 : -1; })]






reply via email to

[Prev in Thread] Current Thread [Next in Thread]