Fix build against ICU 64.1 and later
ClosedPublic

Authored by asturmlechner on May 9 2019, 7:24 PM.

Details

Summary

See also: https://unicode-org.atlassian.net/browse/ICU-20530

Lots of errors of the same kind (libxml/tree.h included within extern "C"):

In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/g++-v8/bits/shared_ptr.h:52,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/g++-v8/memory:81,
                 from /usr/include/unicode/localpointer.h:45,
                 from /usr/include/unicode/uenum.h:23,
                 from /usr/include/unicode/ucnv.h:53,
                 from /usr/include/libxml2/libxml/encoding.h:31,
                 from /usr/include/libxml2/libxml/parser.h:810,
                 from /usr/include/libxml2/libxml/globals.h:18,
                 from /usr/include/libxml2/libxml/threads.h:35,
                 from /usr/include/libxml2/libxml/xmlmemory.h:218,
                 from /usr/include/libxml2/libxml/tree.h:1307,
                 from /var/tmp/portage/kde-misc/tellico-9999/work/tellico-9999/src/translators/xslthandler.h:34,
                 from /var/tmp/portage/kde-misc/tellico-9999/work/tellico-9999/src/translators/xsltimporter.cpp:26:
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/g++-v8/bits/shared_ptr_base.h:338:3: error: template with C linkage
   template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
   ^~~~~~~~
Test Plan

Builds fine against ICU 64.2.

Diff Detail

Repository
R470 Tellico
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
asturmlechner requested review of this revision.May 9 2019, 7:24 PM
asturmlechner created this revision.
asturmlechner edited the summary of this revision. (Show Details)May 9 2019, 7:25 PM

Removing the extern guard for libxml/tree.h seems potentially problematic for older versions of ICU. Any insights there? Maybe there needs to be some sort of version check.

At least with ICU 63 there is no problem with the change, I can't test with older versions. The same thing had to be also done for xmlsec, for reference: https://github.com/lsh123/xmlsec/pull/249

rstephenson accepted this revision.EditedMay 19 2019, 12:23 AM

OK, sounds good. Let's give it a shot

This revision is now accepted and ready to land.May 19 2019, 12:23 AM
This revision was automatically updated to reflect the committed changes.