This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] [BZ #3440] Make LC_ALL etc. useful in #if expressions
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Sat, 28 Apr 2012 16:41:44 -0700
- Subject: [PATCH] [BZ #3440] Make LC_ALL etc. useful in #if expressions
Here's a proposed patch to fix BZ#3440.
http://sourceware.org/bugzilla/show_bug.cgi?id=3440
---
ChangeLog | 9 +++++++++
locale/bits/locale.h | 29 +++++++++++++----------------
2 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 67a29bd..8a9f5fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
+
+ [BZ #3440]
+ * locale/bits/locale.h (__LC_CTYPE, __LC_NUMERIC, __LC_TIME)
+ (__LC_COLLATE, __LC_MONETARY, __LC_MESSAGES, __LC_ALL, __LC_PAPER)
+ (__LC_NAME, __LC_ADDRESS, __LC_TELEPHONE, __LC_MEASUREMENT)
+ (__LC_IDENTIFICATION): Make these macros useful in #if
+ expressions, as required by C99.
+
2012-04-28 Andreas Schwab <schwab@linux-m68k.org>
* math/bits/math-finite.h [__NO_LONG_DOUBLE_MATH]: Redirect long
diff --git a/locale/bits/locale.h b/locale/bits/locale.h
index aa6949f..ffebbb5 100644
--- a/locale/bits/locale.h
+++ b/locale/bits/locale.h
@@ -23,21 +23,18 @@
#ifndef _BITS_LOCALE_H
#define _BITS_LOCALE_H 1
-enum
-{
- __LC_CTYPE = 0,
- __LC_NUMERIC = 1,
- __LC_TIME = 2,
- __LC_COLLATE = 3,
- __LC_MONETARY = 4,
- __LC_MESSAGES = 5,
- __LC_ALL = 6,
- __LC_PAPER = 7,
- __LC_NAME = 8,
- __LC_ADDRESS = 9,
- __LC_TELEPHONE = 10,
- __LC_MEASUREMENT = 11,
- __LC_IDENTIFICATION = 12
-};
+#define __LC_CTYPE 0
+#define __LC_NUMERIC 1
+#define __LC_TIME 2
+#define __LC_COLLATE 3
+#define __LC_MONETARY 4
+#define __LC_MESSAGES 5
+#define __LC_ALL 6
+#define __LC_PAPER 7
+#define __LC_NAME 8
+#define __LC_ADDRESS 9
+#define __LC_TELEPHONE 10
+#define __LC_MEASUREMENT 11
+#define __LC_IDENTIFICATION 12
#endif /* bits/locale.h */
--
1.7.6.5