Fix -Wundef warning

Description

We received the following report:

The recent change to icu libs added two reads from a possibly undefined macro which is causing a warning on Chrome builds
https://cs.chromium.org/chromium/src/third_party/icu/source/common/unicode/uvernum.h?q=U_DISABLE_VERSION_SUFFIX&sq=package:chromium&g=0&l=123

In file included from ../../third_party/harfbuzz-ng/src/src/hb-icu.cc:32:
In file included from ../../third_party/harfbuzz-ng/src/src/hb-icu.h:34:
In file included from ../../third_party/icu/source/common/unicode/uscript.h:20:
In file included from ../../third_party/icu/source/common/unicode/utypes.h:38:
In file included from ../../third_party/icu/source/common/unicode/umachine.h:46:
In file included from ../../third_party/icu/source/common/unicode/ptypes.h:52:
In file included from ../../third_party/icu/source/common/unicode/platform.h:25:
../../third_party/icu/source/common/unicode/uvernum.h:123:8: warning: 'U_DISABLE_VERSION_SUFFIX' is not defined, evaluates to 0 [-Wundef]
#elif !U_DISABLE_VERSION_SUFFIX

Both reads of U_DISABLE_VERSION_SUFFIX should be ifdef / ifndef rather than if

This is another warning that should be enabled by or ICU-13764.

Activity

Show:
Shane Carr
April 8, 2019, 7:51 AM

Looks like the code originated here:


https://github.com/unicode-org/icu/pull/308

Fixed

Assignee

Shane Carr

Reporter

Shane Carr

Components

Labels

None

Reviewer

None

Priority

major

Time Needed

Hours

Fix versions

Configure