From 92992780d179c357356c38ab9852d06c92432ad9 Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Wed, 3 Oct 2007 19:18:52 +0000 Subject: [PATCH] ICU-5835 add friend declaration for the union to see US_STACKBUF_SIZE, for standard-conformant C++ compilers X-SVN-Rev: 22741 --- icu4c/source/common/unicode/unistr.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/icu4c/source/common/unicode/unistr.h b/icu4c/source/common/unicode/unistr.h index 18bf9e05a8..0ee564606f 100644 --- a/icu4c/source/common/unicode/unistr.h +++ b/icu4c/source/common/unicode/unistr.h @@ -3216,6 +3216,7 @@ private: }; friend class StringThreadTest; + friend union StackBufferOrFields; // make US_STACKBUF_SIZE visible inside fUnion /* * The following are all the class fields that are stored @@ -3231,7 +3232,7 @@ private: // (implicit) *vtable; int8_t fShortLength; // 0..127: length <0: real length is in fUnion.fFields.fLength uint8_t fFlags; // bit flags: see constants above - union { + union StackBufferOrFields { // fStackBuffer is used iff (fFlags&kUsingStackBuffer) // else fFields is used UChar fStackBuffer [US_STACKBUF_SIZE]; // buffer for small strings