From c6158c4e0aa0634d87ae800be0959e7a99a84b37 Mon Sep 17 00:00:00 2001 From: Owen Shepherd Date: Sat, 16 Mar 2013 16:37:40 +0000 Subject: [PATCH] PDCLIB-1 * Rename _PDCLIB_wctype_t -> _PDCLIB_wcinfo_t in order to avoid conflict with wctype_t in . * Add testdriver to generated _PDCLIB_unicodedata.c --- functions/locale/UnicodeData.py | 17 +++++++++++++++-- functions/locale/_PDCLIB_unicodedata.c | 15 +++++++++++++-- internals/_PDCLIB_locale.h | 4 ++-- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/functions/locale/UnicodeData.py b/functions/locale/UnicodeData.py index 30fe562..42a8f9f 100644 --- a/functions/locale/UnicodeData.py +++ b/functions/locale/UnicodeData.py @@ -69,9 +69,10 @@ try: * in Exhibit 1 of the Unicode Terms of Use, found at * http://www.unicode.org/copyright.html#Exhibit1 */ + #ifndef REGTEST #include <_PDCLIB_locale.h> - _PDCLIB_wctype_t _PDCLIB_wctype[] = { + _PDCLIB_wcinfo_t _PDCLIB_wcinfo[] = { // { value,\tflags,\tlower,\tupper\t}, // name """) for line in in_file: @@ -90,7 +91,19 @@ try: out_file.write(" { 0x%X,\t0x%X,\t0x%X,\t0x%X }, // %s\n" % ( num, bits, lower_case, upper_case, name)) out_file.write('};\n\n') - out_file.write('size_t _PDCLIB_wctype_size = sizeof(_PDCLIB_wctype) / sizeof(_PDCLIB_wctype[0]);\n\n') + out_file.write(""" +size_t _PDCLIB_wcinfo_size = sizeof(_PDCLIB_wcinfo) / sizeof(_PDCLIB_wcinfo[0]); +#endif + +#ifdef TEST +#include <_PDCLIB_test.h> +int main( void ) +{ + return TEST_RESULTS; +} +#endif + +""") except: in_file.close() out_file.close() diff --git a/functions/locale/_PDCLIB_unicodedata.c b/functions/locale/_PDCLIB_unicodedata.c index 868b5a6..e4e9c83 100644 --- a/functions/locale/_PDCLIB_unicodedata.c +++ b/functions/locale/_PDCLIB_unicodedata.c @@ -10,9 +10,10 @@ * in Exhibit 1 of the Unicode Terms of Use, found at * http://www.unicode.org/copyright.html#Exhibit1 */ + #ifndef REGTEST #include <_PDCLIB_locale.h> - _PDCLIB_wctype_t _PDCLIB_wctype[] = { + _PDCLIB_wcinfo_t _PDCLIB_wcinfo[] = { // { value, flags, lower, upper }, // name { 0x0, 0x4, 0x0, 0x0 }, // { 0x1, 0x4, 0x1, 0x1 }, // @@ -24445,5 +24446,15 @@ { 0x10FFFD, 0x0, 0x10FFFD, 0x10FFFD }, // }; -size_t _PDCLIB_wctype_size = sizeof(_PDCLIB_wctype) / sizeof(_PDCLIB_wctype[0]); + +size_t _PDCLIB_wcinfo_size = sizeof(_PDCLIB_wcinfo) / sizeof(_PDCLIB_wcinfo[0]); +#endif + +#ifdef TEST +#include <_PDCLIB_test.h> +int main( void ) +{ + return TEST_RESULTS; +} +#endif diff --git a/internals/_PDCLIB_locale.h b/internals/_PDCLIB_locale.h index 9c008e0..09fa3c0 100644 --- a/internals/_PDCLIB_locale.h +++ b/internals/_PDCLIB_locale.h @@ -67,13 +67,13 @@ typedef struct _PDCLIB_ctype unsigned char collation; } _PDCLIB_ctype_t; -typedef struct _PDCLIB_wctype +typedef struct _PDCLIB_wcinfo { _PDCLIB_uint32_t num; _PDCLIB_uint16_t flags; _PDCLIB_uint32_t lower; _PDCLIB_uint32_t upper; -} _PDCLIB_wctype_t; +} _PDCLIB_wcinfo_t; struct _PDCLIB_locale { _PDCLIB_charcodec_t _Codec; -- 2.40.0