From: Markus Scherer Date: Thu, 14 Sep 2017 06:24:35 +0000 (+0000) Subject: ICU-13340 obsolete unicode/utf_old.h: add U_HIDE_OBSOLETE_UTF_OLD_H to optionally... X-Git-Tag: release-60-rc~143 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03f431d30d54cad77b7994c00bb28f65661bde94;p=icu ICU-13340 obsolete unicode/utf_old.h: add U_HIDE_OBSOLETE_UTF_OLD_H to optionally hide all of the .h contents; default: no behavior change; adjust code & tests to work either way X-SVN-Rev: 40413 --- diff --git a/icu4c/readme.html b/icu4c/readme.html index 953ff43bc74..68d4804577b 100644 --- a/icu4c/readme.html +++ b/icu4c/readme.html @@ -630,6 +630,14 @@ (via -D or uconfig.h, as above) and include those header files explicitly that you actually need.
Note: The ICU test suites cannot be compiled with this setting. +
  • utf_old.h: + All of utf_old.h is deprecated or obsolete.
    + Beginning with ICU 60, + you should define U_HIDE_OBSOLETE_UTF_OLD_H to 1 + (via -D or uconfig.h, as above). + Use of any of these macros should be replaced as noted + in the comments for the obsolete macro.
    + Note: The ICU test suites can be compiled with this setting.
  • .dat file: By default, the ICU data is built into a shared library (DLL). This is convenient because it requires no install-time or runtime configuration, diff --git a/icu4c/source/common/unicode/utf_old.h b/icu4c/source/common/unicode/utf_old.h index 250cb8c0ae0..55c17c01df6 100644 --- a/icu4c/source/common/unicode/utf_old.h +++ b/icu4c/source/common/unicode/utf_old.h @@ -145,7 +145,22 @@ #ifndef __UTF_OLD_H__ #define __UTF_OLD_H__ -#ifndef U_HIDE_DEPRECATED_API +/** + * \def U_HIDE_OBSOLETE_UTF_OLD_H + * + * Hides the obsolete definitions in unicode/utf_old.h. + * Recommended to be set to 1 at compile time to make sure + * the long-deprecated macros are no longer used. + * + * For reasons for the deprecation see the utf_old.h file comments. + * + * @internal + */ +#ifndef U_HIDE_OBSOLETE_UTF_OLD_H +# define U_HIDE_OBSOLETE_UTF_OLD_H 0 +#endif + +#if !defined(U_HIDE_DEPRECATED_API) && !U_HIDE_OBSOLETE_UTF_OLD_H #include "unicode/utf.h" #include "unicode/utf8.h" @@ -1184,7 +1199,6 @@ U_CFUNC U_IMPORT const uint8_t utf8_countTrailBytes[]; /* U_IMPORT2? */ /*U_I */ #define UTF_SET_CHAR_LIMIT(s, start, i, length) U16_SET_CP_LIMIT(s, start, i, length) -#endif /* U_HIDE_DEPRECATED_API */ +#endif // !U_HIDE_DEPRECATED_API && !U_HIDE_OBSOLETE_UTF_OLD_H #endif - diff --git a/icu4c/source/common/utf_impl.cpp b/icu4c/source/common/utf_impl.cpp index 293e6f181f3..856072cb767 100644 --- a/icu4c/source/common/utf_impl.cpp +++ b/icu4c/source/common/utf_impl.cpp @@ -27,7 +27,6 @@ #include "unicode/utypes.h" #include "unicode/utf.h" #include "unicode/utf8.h" -#include "unicode/utf_old.h" #include "uassert.h" /* @@ -93,7 +92,10 @@ utf8_minLegal[4]={ 0, 0x80, 0x800, 0x10000 }; static const UChar32 utf8_errorValue[6]={ - UTF8_ERROR_VALUE_1, UTF8_ERROR_VALUE_2, UTF_ERROR_VALUE, 0x10ffff, + // Same values as UTF8_ERROR_VALUE_1, UTF8_ERROR_VALUE_2, UTF_ERROR_VALUE, + // but without relying on the obsolete unicode/utf_old.h. + 0x15, 0x9f, 0xffff, + 0x10ffff, 0x3ffffff, 0x7fffffff }; @@ -232,7 +234,7 @@ utf8_appendCharSafeBody(uint8_t *s, int32_t i, int32_t length, UChar32 c, UBool s+=i; offset=0; c=utf8_errorValue[length-1]; - UTF8_APPEND_CHAR_UNSAFE(s, offset, c); + U8_APPEND_UNSAFE(s, offset, c); i=i+offset; } } diff --git a/icu4c/source/test/cintltst/cbiditransformtst.c b/icu4c/source/test/cintltst/cbiditransformtst.c index 0d2fe4fba8e..1ce753d73cb 100644 --- a/icu4c/source/test/cintltst/cbiditransformtst.c +++ b/icu4c/source/test/cintltst/cbiditransformtst.c @@ -16,6 +16,7 @@ #include "unicode/ubiditransform.h" #include "unicode/ushape.h" #include "unicode/ustring.h" +#include "unicode/utf16.h" #ifdef __cplusplus extern "C" { diff --git a/icu4c/source/test/cintltst/cintltst.h b/icu4c/source/test/cintltst/cintltst.h index ef6a42f1c3d..d038f36308e 100644 --- a/icu4c/source/test/cintltst/cintltst.h +++ b/icu4c/source/test/cintltst/cintltst.h @@ -25,11 +25,6 @@ The main root for C API tests #include "unicode/putil.h" #include "unicode/ctest.h" -#if U_NO_DEFAULT_INCLUDE_UTF_HEADERS -/* deprecated - make tests pass with U_NO_DEFAULT_INCLUDE_UTF_HEADERS */ -#include "unicode/utf_old.h" -#endif - #include #ifndef U_USE_DEPRECATED_API diff --git a/icu4c/source/test/cintltst/citertst.c b/icu4c/source/test/cintltst/citertst.c index 895b29b2f61..c93c19c3685 100644 --- a/icu4c/source/test/cintltst/citertst.c +++ b/icu4c/source/test/cintltst/citertst.c @@ -28,6 +28,7 @@ #include "unicode/uloc.h" #include "unicode/uchar.h" #include "unicode/ustring.h" +#include "unicode/utf16.h" #include "unicode/putil.h" #include "callcoll.h" #include "cmemory.h" diff --git a/icu4c/source/test/cintltst/crestst.c b/icu4c/source/test/cintltst/crestst.c index 03cf52c3ea5..9d832fcf379 100644 --- a/icu4c/source/test/cintltst/crestst.c +++ b/icu4c/source/test/cintltst/crestst.c @@ -20,6 +20,7 @@ #include "unicode/utypes.h" #include "cintltst.h" #include "unicode/ustring.h" +#include "unicode/utf16.h" #include "cmemory.h" #include "cstring.h" #include "filestrm.h" diff --git a/icu4c/source/test/cintltst/creststn.c b/icu4c/source/test/cintltst/creststn.c index da64f20f921..48717c10653 100644 --- a/icu4c/source/test/cintltst/creststn.c +++ b/icu4c/source/test/cintltst/creststn.c @@ -23,6 +23,8 @@ #include "unicode/putil.h" #include "unicode/ustring.h" #include "unicode/ucnv.h" +#include "unicode/utf8.h" +#include "unicode/utf16.h" #include "string.h" #include "cmemory.h" #include "cstring.h" diff --git a/icu4c/source/test/cintltst/cucdtst.c b/icu4c/source/test/cintltst/cucdtst.c index 8b9e8bb67b9..788aa803757 100644 --- a/icu4c/source/test/cintltst/cucdtst.c +++ b/icu4c/source/test/cintltst/cucdtst.c @@ -25,7 +25,8 @@ #include "unicode/ustring.h" #include "unicode/uloc.h" #include "unicode/unorm2.h" - +#include "unicode/utf16.h" +#include "unicode/utf_old.h" #include "cintltst.h" #include "putilimp.h" #include "uparse.h" @@ -1387,6 +1388,26 @@ static void TestCodeUnit(){ for(i=0; i= 4 && i< 8){ + if(!(U16_IS_LEAD(c)) || U16_IS_SINGLE(c) || U16_IS_TRAIL(c) || + !U16_IS_SURROGATE(c) || !U_IS_SURROGATE(c)){ + log_err("ERROR: U+%04x is a first surrogate", c); + } + } + if(i >= 8 && i< 12){ + if(!(U16_IS_TRAIL(c)) || U16_IS_SINGLE(c) || U16_IS_LEAD(c) || + !U16_IS_SURROGATE(c) || !U_IS_SURROGATE(c)){ + log_err("ERROR: U+%04x is a second surrogate", c); + } + } +#if !U_HIDE_OBSOLETE_UTF_OLD_H if(i<4){ if(!(UTF_IS_SINGLE(c)) || (UTF_IS_LEAD(c)) || (UTF_IS_TRAIL(c)) ||(UTF_IS_SURROGATE(c))){ log_err("ERROR: U+%04x is a single", c); @@ -1403,8 +1424,8 @@ static void TestCodeUnit(){ log_err("ERROR: U+%04x is a second surrogate", c); } } +#endif } - } static void TestCodePoint(){ @@ -1437,42 +1458,72 @@ static void TestCodePoint(){ 0xfffe, }; int32_t i; - for(i=0; i=6 && i<18) { + if(U_IS_SURROGATE(c) || U16_IS_SURROGATE(c)) { + log_err("ERROR: isSurrogate() failed for U+%04x\n", c); + } + if(!U_IS_UNICODE_CHAR(c)) { + log_err("ERROR: isUnicodeChar() failed for U+%04x\n", c); + } + } else if(i >=18 && i<20) { + if(U_IS_SURROGATE(c) || U16_IS_SURROGATE(c)) { + log_err("ERROR: isSurrogate() failed for U+%04x\n", c); + } + if(!U_IS_UNICODE_CHAR(c)) { + log_err("ERROR: isUnicodeChar() failed for U+%04x\n", c); + } + } else if(i >=18 && i=6 && i<18){ - if(UTF_IS_SURROGATE(c) || U_IS_SURROGATE(c) || U16_IS_SURROGATE(c)){ + if(UTF_IS_SURROGATE(c)){ log_err("ERROR: isSurrogate() failed for U+%04x\n", c); } if(!UTF_IS_VALID(c)){ log_err("ERROR: isValid() failed for U+%04x\n", c); } - if(!UTF_IS_UNICODE_CHAR(c) || !U_IS_UNICODE_CHAR(c)){ + if(!UTF_IS_UNICODE_CHAR(c)){ log_err("ERROR: isUnicodeChar() failed for U+%04x\n", c); } if(UTF_IS_ERROR(c)){ log_err("ERROR: isError() failed for U+%04x\n", c); } }else if(i >=18 && i<20){ - if(UTF_IS_SURROGATE(c) || U_IS_SURROGATE(c) || U16_IS_SURROGATE(c)){ + if(UTF_IS_SURROGATE(c)){ log_err("ERROR: isSurrogate() failed for U+%04x\n", c); } if(UTF_IS_VALID(c)){ log_err("ERROR: isValid() failed for U+%04x\n", c); } - if(!UTF_IS_UNICODE_CHAR(c) || !U_IS_UNICODE_CHAR(c)){ + if(!UTF_IS_UNICODE_CHAR(c)){ log_err("ERROR: isUnicodeChar() failed for U+%04x\n", c); } if(!UTF_IS_ERROR(c)){ @@ -1480,19 +1531,20 @@ static void TestCodePoint(){ } } else if(i >=18 && i #include "unicode/utypes.h" +#include "unicode/utf8.h" #include "utrie2.h" #include "utrie.h" #include "cstring.h" diff --git a/icu4c/source/test/cintltst/ucnvseltst.c b/icu4c/source/test/cintltst/ucnvseltst.c index 6d4dc2d9b1e..deb0a2b9f8e 100644 --- a/icu4c/source/test/cintltst/ucnvseltst.c +++ b/icu4c/source/test/cintltst/ucnvseltst.c @@ -22,6 +22,7 @@ #include "unicode/utypes.h" #include "unicode/ucnvsel.h" #include "unicode/ustring.h" +#include "unicode/utf8.h" #include "cmemory.h" #include "cstring.h" #include "propsvec.h" diff --git a/icu4c/source/test/cintltst/utf16tst.c b/icu4c/source/test/cintltst/utf16tst.c index b73c6083efd..2d3cecdd71e 100644 --- a/icu4c/source/test/cintltst/utf16tst.c +++ b/icu4c/source/test/cintltst/utf16tst.c @@ -16,14 +16,27 @@ */ #include "unicode/utypes.h" -#include "unicode/utf16.h" #include "unicode/ustring.h" +#include "unicode/utf16.h" +#include "unicode/utf_old.h" #include "cmemory.h" #include "cstring.h" #include "cintltst.h" #include -static void printUChars(const UChar *uchars); +// Obsolete macro from obsolete unicode/utf_old.h, for some old test data. +#ifndef UTF_ERROR_VALUE +# define UTF_ERROR_VALUE 0xffff +#endif + +#if !U_HIDE_OBSOLETE_UTF_OLD_H +static void printUChars(const UChar *uchars) { + int16_t i=0; + for(i=0; i= 4 && i< 8){ - if(!UTF16_IS_LEAD(c) || UTF16_IS_SINGLE(c) || UTF16_IS_TRAIL(c) || !U16_IS_LEAD(c) || U16_IS_SINGLE(c) || U16_IS_TRAIL(c)){ + if( +#if !U_HIDE_OBSOLETE_UTF_OLD_H + !UTF16_IS_LEAD(c) || UTF16_IS_SINGLE(c) || UTF16_IS_TRAIL(c) || +#endif + !U16_IS_LEAD(c) || U16_IS_SINGLE(c) || U16_IS_TRAIL(c)){ log_err("ERROR: %x is a first surrogate\n", c); } } if(i >= 8 && i< 12){ - if(!UTF16_IS_TRAIL(c) || UTF16_IS_SINGLE(c) || UTF16_IS_LEAD(c) || !U16_IS_TRAIL(c) || U16_IS_SINGLE(c) || U16_IS_LEAD(c)){ + if( +#if !U_HIDE_OBSOLETE_UTF_OLD_H + !UTF16_IS_TRAIL(c) || UTF16_IS_SINGLE(c) || UTF16_IS_LEAD(c) || +#endif + !U16_IS_TRAIL(c) || U16_IS_SINGLE(c) || U16_IS_LEAD(c)) { log_err("ERROR: %x is a second surrogate\n", c); } } @@ -95,18 +120,26 @@ static void TestCharLength() }; int16_t i; +#if !U_HIDE_OBSOLETE_UTF_OLD_H UBool multiple; +#endif for(i=0; i 0; --offset){ setOffset=offset; +#if !U_HIDE_OBSOLETE_UTF_OLD_H UTF16_PREV_CHAR_UNSAFE(input, setOffset, c); if(setOffset != movedOffset[i+3]){ log_err("ERROR: UTF16_PREV_CHAR_UNSAFE failed to move the offset correctly at %d\n ExpectedOffset:%d Got %d\n", @@ -302,7 +338,7 @@ static void TestNextPrevChar(){ if(c != result[i+3]){ log_err("ERROR: UTF16_PREV_CHAR_UNSAFE failed for offset=%ld. Expected:%lx Got:%lx\n", offset, result[i+3], c); } - +#endif setOffset=offset; U16_PREV_UNSAFE(input, setOffset, c); if(setOffset != movedOffset[i+3]){ @@ -312,7 +348,7 @@ static void TestNextPrevChar(){ if(c != result[i+3]){ log_err("ERROR: U16_PREV_CHAR_UNSAFE failed for offset=%ld. Expected:%lx Got:%lx\n", offset, result[i+3], c); } - +#if !U_HIDE_OBSOLETE_UTF_OLD_H setOffset=offset; UTF16_PREV_CHAR_SAFE(input, 0, setOffset, c, FALSE); if(setOffset != movedOffset[i+4]){ @@ -322,7 +358,7 @@ static void TestNextPrevChar(){ if(c != result[i+4]){ log_err("ERROR: UTF16_PREV_CHAR_SAFE failed for input=%ld. Expected:%lx Got:%lx\n", offset, result[i+4], c); } - +#endif setOffset=offset; U16_PREV(input, 0, setOffset, c); if(setOffset != movedOffset[i+4]){ @@ -344,7 +380,7 @@ static void TestNextPrevChar(){ if(c != expected) { log_err("ERROR: U16_PREV_OR_FFFD failed for input=%ld. Expected:%lx Got:%lx\n", offset, expected, c); } - +#if !U_HIDE_OBSOLETE_UTF_OLD_H setOffset=offset; UTF16_PREV_CHAR_SAFE(input, 0, setOffset, c, TRUE); if(setOffset != movedOffset[i+5]){ @@ -354,7 +390,7 @@ static void TestNextPrevChar(){ if(c != result[i+5]){ log_err("ERROR: UTF16_PREV_CHAR_SAFE(strict) failed for input=%ld. Expected:%lx Got:%lx\n", offset, result[i+5], c); } - +#endif i=(uint16_t)(i+6); } @@ -456,6 +492,7 @@ static void TestFwdBack(){ uint16_t offunsafe=0, offsafe=0; uint16_t i=0; +#if !U_HIDE_OBSOLETE_UTF_OLD_H while(offunsafe < UPRV_LENGTHOF(input)){ UTF16_FWD_1_UNSAFE(input, offunsafe); if(offunsafe != fwd_unsafe[i]){ @@ -463,7 +500,7 @@ static void TestFwdBack(){ } i++; } - +#endif offunsafe=0, offsafe=0; i=0; while(offunsafe < UPRV_LENGTHOF(input)){ @@ -473,7 +510,8 @@ static void TestFwdBack(){ } i++; } - +#if !U_HIDE_OBSOLETE_UTF_OLD_H + offunsafe=0, offsafe=0; i=0; while(offsafe < UPRV_LENGTHOF(input)){ UTF16_FWD_1_SAFE(input, offsafe, UPRV_LENGTHOF(input)); @@ -482,7 +520,8 @@ static void TestFwdBack(){ } i++; } - +#endif + offunsafe=0, offsafe=0; i=0; while(offsafe < UPRV_LENGTHOF(input)){ U16_FWD_1(input, offsafe, UPRV_LENGTHOF(input)); @@ -491,7 +530,7 @@ static void TestFwdBack(){ } i++; } - +#if !U_HIDE_OBSOLETE_UTF_OLD_H offunsafe=UPRV_LENGTHOF(input); offsafe=UPRV_LENGTHOF(input); i=0; @@ -502,7 +541,7 @@ static void TestFwdBack(){ } i++; } - +#endif offunsafe=UPRV_LENGTHOF(input); offsafe=UPRV_LENGTHOF(input); i=0; @@ -513,7 +552,9 @@ static void TestFwdBack(){ } i++; } - +#if !U_HIDE_OBSOLETE_UTF_OLD_H + offunsafe=UPRV_LENGTHOF(input); + offsafe=UPRV_LENGTHOF(input); i=0; while(offsafe > 0){ UTF16_BACK_1_SAFE(input,0, offsafe); @@ -522,7 +563,9 @@ static void TestFwdBack(){ } i++; } - +#endif + offunsafe=UPRV_LENGTHOF(input); + offsafe=UPRV_LENGTHOF(input); i=0; while(offsafe > 0){ U16_BACK_1(input,0, offsafe); @@ -534,13 +577,14 @@ static void TestFwdBack(){ offunsafe=0; offsafe=0; +#if !U_HIDE_OBSOLETE_UTF_OLD_H for(i=0; i 0) { +#if !U_HIDE_OBSOLETE_UTF_OLD_H setOffset=offset; UTF16_SET_CHAR_LIMIT_UNSAFE(input, setOffset); if(setOffset != limit_unsafe[i]){ log_err("ERROR: UTF16_SET_CHAR_LIMIT_UNSAFE failed for offset=%ld. Expected:%lx Got:%lx\n", offset, limit_unsafe[i], setOffset); } - +#endif setOffset=offset; U16_SET_CP_LIMIT_UNSAFE(input, setOffset); if(setOffset != limit_unsafe[i]){ @@ -659,6 +703,7 @@ static void TestSetChar(){ } static void TestAppendChar(){ +#if !U_HIDE_OBSOLETE_UTF_OLD_H static UChar s[5]={0x0061, 0x0062, 0x0063, 0x0064, 0x0000}; static uint32_t test[]={ /*append-position(unsafe), CHAR to be appended */ @@ -754,7 +799,7 @@ static void TestAppendChar(){ count++; } free(str); - +#endif } static void TestAppend() { @@ -822,27 +867,28 @@ static void TestSurrogate(){ static UChar32 s[] = {0x10000, 0x10ffff, 0x50000, 0x100000, 0x1abcd}; int i = 0; while (i < 5) { - UChar first = UTF_FIRST_SURROGATE(s[i]); - UChar second = UTF_SECOND_SURROGATE(s[i]); + UChar first = U16_LEAD(s[i]); + UChar second = U16_TRAIL(s[i]); /* algorithm from the Unicode consortium */ UChar firstresult = (UChar)(((s[i] - 0x10000) / 0x400) + 0xD800); UChar secondresult = (UChar)(((s[i] - 0x10000) % 0x400) + 0xDC00); - if (first != UTF16_LEAD(s[i]) || first != U16_LEAD(s[i]) || first != firstresult) { + if ( +#if !U_HIDE_OBSOLETE_UTF_OLD_H + first != UTF16_LEAD(s[i]) || first != UTF_FIRST_SURROGATE(s[i]) || +#endif + first != firstresult) { log_err("Failure in first surrogate in 0x%x expected to be 0x%x\n", s[i], firstresult); } - if (second != UTF16_TRAIL(s[i]) || second != U16_TRAIL(s[i]) || second != secondresult) { + if ( +#if !U_HIDE_OBSOLETE_UTF_OLD_H + second != UTF16_TRAIL(s[i]) || second != UTF_SECOND_SURROGATE(s[i]) || +#endif + second != secondresult) { log_err("Failure in second surrogate in 0x%x expected to be 0x%x\n", s[i], secondresult); } i ++; } } - -static void printUChars(const UChar *uchars){ - int16_t i=0; - for(i=0; i 0; --offset){ + expected=result[i+4]; +#if !U_HIDE_OBSOLETE_UTF_OLD_H setOffset=offset; UTF8_PREV_CHAR_SAFE(input, 0, setOffset, c, FALSE); if(setOffset != movedOffset[i+4]){ log_err("ERROR: UTF8_PREV_CHAR_SAFE failed to move the offset correctly at %d\n ExpectedOffset:%d Got %d\n", offset, movedOffset[i+4], setOffset); } - expected=result[i+4]; if(c != expected){ log_err("ERROR: UTF8_PREV_CHAR_SAFE failed for input=%ld. Expected:%lx Got:%lx\n", offset, expected, c); } - +#endif setOffset=offset; U8_PREV(input, 0, setOffset, c); if(setOffset != movedOffset[i+4]){ @@ -367,7 +413,7 @@ static void TestNextPrevChar() { if(c != expected){ log_err("ERROR: U8_PREV_OR_FFFD failed for input=%ld. Expected:%lx Got:%lx\n", offset, expected, c); } - +#if !U_HIDE_OBSOLETE_UTF_OLD_H setOffset=offset; UTF8_PREV_CHAR_SAFE(input, 0, setOffset, c, TRUE); if(setOffset != movedOffset[i+5]){ @@ -377,7 +423,7 @@ static void TestNextPrevChar() { if(c != result[i+5]){ log_err("ERROR: UTF8_PREV_CHAR_SAFE(strict) failed for input=%ld. Expected:%lx Got:%lx\n", offset, result[i+5], c); } - +#endif i=i+6; } } @@ -527,6 +573,7 @@ static void TestNextPrevCharUnsafe() { UChar32 c; int32_t i; uint32_t offset; +#if !U_HIDE_OBSOLETE_UTF_OLD_H for(i=0, offset=0; offset 0; --i){ UTF8_PREV_CHAR_UNSAFE(input, offset, c); if(c != codePoints[i]){ @@ -549,6 +597,7 @@ static void TestNextPrevCharUnsafe() { offset, codePoints[i], c); } } +#endif for(i=UPRV_LENGTHOF(codePoints)-1, offset=sizeof(input); offset > 0; --i){ U8_PREV_UNSAFE(input, offset, c); if(c != codePoints[i]){ @@ -570,6 +619,7 @@ static void TestFwdBack() { uint32_t offsafe=0; uint32_t i=0; +#if !U_HIDE_OBSOLETE_UTF_OLD_H while(offsafe < sizeof(input)){ UTF8_FWD_1_SAFE(input, offsafe, sizeof(input)); if(offsafe != fwd_safe[i]){ @@ -577,7 +627,8 @@ static void TestFwdBack() { } i++; } - +#endif + offsafe=0; i=0; while(offsafe < sizeof(input)){ U8_FWD_1(input, offsafe, sizeof(input)); @@ -586,7 +637,7 @@ static void TestFwdBack() { } i++; } - +#if !U_HIDE_OBSOLETE_UTF_OLD_H i=0; offsafe=sizeof(input); while(offsafe > 0){ @@ -596,7 +647,7 @@ static void TestFwdBack() { } i++; } - +#endif i=0; offsafe=sizeof(input); while(offsafe > 0){ @@ -606,7 +657,7 @@ static void TestFwdBack() { } i++; } - +#if !U_HIDE_OBSOLETE_UTF_OLD_H offsafe=0; for(i=0; i0; --i) { UTF8_BACK_1_UNSAFE(input, offset); if(offset != boundaries[i]){ log_err("ERROR: UTF8_BACK_1_UNSAFE offset expected:%d, Got:%d\n", boundaries[i], offset); } } +#endif for(i=UPRV_LENGTHOF(boundaries)-2, offset=UPRV_LENGTHOF(input); offset>0; --i) { U8_BACK_1_UNSAFE(input, offset); if(offset != boundaries[i]){ log_err("ERROR: U8_BACK_1_UNSAFE offset expected:%d, Got:%d\n", boundaries[i], offset); } } - +#if !U_HIDE_OBSOLETE_UTF_OLD_H for(i=0; i