aboutsummaryrefslogtreecommitdiffstats
path: root/include/runetype.h
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1996-05-01 00:40:10 +0000
committerBruce Evans <bde@FreeBSD.org>1996-05-01 00:40:10 +0000
commitcdd84b02119661919861a0ce13cffa523d3e93a9 (patch)
treeb4f19035144b5bb4ec62efb83042948423f85486 /include/runetype.h
parent494908b12c364c19a509066a0854da867b467a21 (diff)
downloadsrc-cdd84b02119661919861a0ce13cffa523d3e93a9.tar.gz
src-cdd84b02119661919861a0ce13cffa523d3e93a9.zip
Fixed longstanding namespace convolution involving rune_t vs wchar_t.
If _ANSI_SOURCE or _POSIX_SOURCE is defined, then <ctype.h> had to be included before <stddef.h> or <stdlib.h> to get rune_t declared. Now rune_t is declared perfectly bogusly in all cases when <ctype.h> is included. This change breaks similar (but more convoluted) convolutions in the stddef.h in gcc distributions. Ports of gcc should avoid using the gcc headers.
Notes
Notes: svn path=/head/; revision=15483
Diffstat (limited to 'include/runetype.h')
-rw-r--r--include/runetype.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/runetype.h b/include/runetype.h
index 057cc35eb633..e7fdf5d74b11 100644
--- a/include/runetype.h
+++ b/include/runetype.h
@@ -39,13 +39,12 @@
#ifndef _RUNETYPE_H_
#define _RUNETYPE_H_
-#include <machine/ansi.h>
#include <sys/cdefs.h>
+#include <machine/ansi.h>
-#ifdef _BSD_WCHAR_T_
-typedef _BSD_WCHAR_T_ rune_t;
-typedef _BSD_WCHAR_T_ wchar_t;
-#undef _BSD_WCHAR_T_
+#ifdef _BSD_RUNE_T_
+typedef _BSD_RUNE_T_ rune_t;
+#undef _BSD_RUNE_T_
#endif
#ifdef _BSD_SIZE_T_
@@ -53,6 +52,11 @@ typedef _BSD_SIZE_T_ size_t;
#undef _BSD_SIZE_T_
#endif
+#ifdef _BSD_WCHAR_T_
+typedef _BSD_WCHAR_T_ wchar_t;
+#undef _BSD_WCHAR_T_
+#endif
+
#define _CACHED_RUNES (1 <<8 ) /* Must be a power of 2 */
#define _CRMASK (~(_CACHED_RUNES - 1))