user build broken: U_SHOW_CPLUSPLUS_API used before including ICU headers

Description

We have broken builds with ICU 65rc due to this in icu4c/source/i18n/unicode/plurrule.h (didn't check other files):

which I believe is from [ICU-20530].

If the user does not include another ICU header before this, then U_SHOW_CPLUSPLUS_API is not yet defined, and the headers appears empty. Not even the icu namespace gets defined.

Please swap the order:

Essentially, we need to be careful to always include utypes.h before testing any configuration macros.

Please also check files other than plurrule.h.

This could be testable in the header test by adding something to the test .cpp files that requires the icu namespace to be defined. Maybe forward-declare a class inside the namespace?

Assignee

Jeff Genovy

Reporter

Markus Scherer

Components

Labels

None

Reviewer

None

Priority

major

Time Needed

Minutes

Fix versions

Configure