Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2005-03-17 23:11:23 +0300
committerJeff Johnston <jjohnstn@redhat.com>2005-03-17 23:11:23 +0300
commitdd801fdabd7e6d80e69cbde473b723a6ef7cff86 (patch)
tree6927d01de5dcee48cb0966fd11a634b4ba399195 /newlib/libc/ctype
parent993317d0ed9a7bee9b461e63a762b6df249ef867 (diff)
2005-03-17 Jeff Johnston <jjohnstn@redhat.com>
* configure.in: Add new check to see if compiler supports aliasing of arrays and define _HAVE_ARRAY_ALIASING if true. * configure: Regenerated. * Makefile.in: Ditto. * newlib.hin: Add _HAVE_ARRAY_ALIASING. * libc/ctype/ctype_.c: Check for _HAVE_ARRAY_ALIASING before aliasing the _ctype_ array to _ctype_b. * libc/include/ctype.h: Change macros to use __ctype_ptr. Mark _ctype_ as deprecated.
Diffstat (limited to 'newlib/libc/ctype')
-rw-r--r--newlib/libc/ctype/ctype_.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/newlib/libc/ctype/ctype_.c b/newlib/libc/ctype/ctype_.c
index 9991dd222..5551dbdc9 100644
--- a/newlib/libc/ctype/ctype_.c
+++ b/newlib/libc/ctype/ctype_.c
@@ -84,21 +84,40 @@ static _CONST char _ctype_b[128 + 256] = {
_CTYPE_DATA_128_256
};
-#if defined(__CYGWIN__)
-extern _CONST char __declspec(dllexport) _ctype_[1 + 256] __attribute__ ((alias ("_ctype_b+127")));
+# if defined(__CYGWIN__)
_CONST char __declspec(dllexport) *__ctype_ptr = _ctype_b + 128;
-#else
-extern _CONST char _ctype_[1 + 256] __attribute__ ((alias ("_ctype_b+127")));
+# else
_CONST char *__ctype_ptr = _ctype_b + 128;
-#endif
+# endif
+
+# if defined(_HAVE_ARRAY_ALIASING)
+
+# if defined(__CYGWIN__)
+extern _CONST char __declspec(dllexport) _ctype_[1 + 256] __attribute__ ((alias ("_ctype_b+127")));
+# else
+extern _CONST char _ctype_[1 + 256] __attribute__ ((alias ("_ctype_b+127")));
+# endif
+
+# else /* !_HAVE_ARRAY_ALIASING */
+
+# if defined(__CYGWIN__)
+_CONST char __declspec(dllexport) _ctype_[1 + 256] = {
+# else
+_CONST char _ctype_[1 + 256] = {
+# endif
+ 0,
+ _CTYPE_DATA_0_127,
+ _CTYPE_DATA_128_256
+};
+# endif /* !_HAVE_ARRAY_ALIASING */
#else /* !defined(ALLOW_NEGATIVE_CTYPE_INDEX) */
-#if defined(__CYGWIN__)
+# if defined(__CYGWIN__)
_CONST char __declspec(dllexport) _ctype_[1 + 256] = {
-#else
+# else
_CONST char _ctype_[1 + 256] = {
-#endif
+# endif
0,
_CTYPE_DATA_0_127,
_CTYPE_DATA_128_256