We're updating the issue view to help you get more done. 

Can't build ICU4C when U_HIDE_INTERNAL_API is defined

Description

ICU has the following code. UTEXT_MAGIC is defined in the U_HIDE_INTERNAL_API block.
https://github.com/unicode-org/icu/blob/master/icu4c/source/common/unicode/utext.h

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 #ifndef U_HIDE_INTERNAL_API /** * @internal * Value used to help identify correctly initialized UText structs. * Note: must be publicly visible so that UTEXT_INITIALIZER can access it. */ enum { UTEXT_MAGIC = 0x345ad82c }; #endif /* U_HIDE_INTERNAL_API */ /** * initializer to be used with local (stack) instances of a UText * struct. UText structs must be initialized before passing * them to one of the utext_open functions. * * @stable ICU 3.6 */ #define UTEXT_INITIALIZER { \ UTEXT_MAGIC, /* magic */ \ 0, /* flags */ \ 0, /* providerProps */ \ sizeof(UText), /* sizeOfStruct */ \ 0, /* chunkNativeLimit */ \ 0, /* extraSize */ \ 0, /* nativeIndexingLimit */ \ 0, /* chunkNativeStart */ \ 0, /* chunkOffset */ \ 0, /* chunkLength */ \ NULL, /* chunkContents */ \ NULL, /* pFuncs */ \ NULL, /* pExtra */ \ NULL, /* context */ \ NULL, NULL, NULL, /* p, q, r */ \ NULL, /* privP */ \ 0, 0, 0, /* a, b, c */ \ 0, 0, 0 /* privA,B,C, */ \ }

can't build when U_HIDE_INTERNAL_API is defined. The following is the example code that cause the build failure.

1 UText mUText = UTEXT_INITIALIZER;

error: use of undeclared identifier 'UTEXT_MAGIC'

Status

Assignee

Peter Edberg

Reporter

Victor Chang

Labels

None

Reviewer

None

Time Needed

Hours

Start date

None

Components

Fix versions

Priority

critical