This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
PATCH: Support __WORDSIZE == 64 in i386/bits/wchar.h
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 31 May 2012 08:47:24 -0700
- Subject: PATCH: Support __WORDSIZE == 64 in i386/bits/wchar.h
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
To use the same bits/wchar.h for i386 and x86-64, this patch
adds __WORDSIZE == 64 support to i386/bits/wchar.h. OK to
install?
Thanks.
H.J.
---
* sysdeps/unix/sysv/linux/i386/bits/wchar.h: Include
<bits/wordsize.h>.
(__WCHAR_MIN): Support __WORDSIZE == 64.
(__WCHAR_MAX): Likewise.
diff --git a/sysdeps/unix/sysv/linux/i386/bits/wchar.h b/sysdeps/unix/sysv/linux/i386/bits/wchar.h
index b94fc7a..ec0f34a 100644
--- a/sysdeps/unix/sysv/linux/i386/bits/wchar.h
+++ b/sysdeps/unix/sysv/linux/i386/bits/wchar.h
@@ -1,5 +1,5 @@
-/* wchar_t type related definitions.
- Copyright (C) 2000 Free Software Foundation, Inc.
+/* wchar_t type related definitions. i386/x86-64 version.
+ Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,14 @@
#ifndef _BITS_WCHAR_H
#define _BITS_WCHAR_H 1
-#define __WCHAR_MIN (-2147483647l - 1l)
-#define __WCHAR_MAX (2147483647l)
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+# define __WCHAR_MIN (-2147483647 - 1)
+# define __WCHAR_MAX (2147483647)
+#else
+# define __WCHAR_MIN (-2147483647l - 1l)
+# define __WCHAR_MAX (2147483647l)
+#endif
#endif /* bits/wchar.h */