1 From 71841b7aa7c5e75a793cfaafb31865524a74d9fc Mon Sep 17 00:00:00 2001
2 From: David Tardon <dtardon@redhat.com>
3 Date: Thu, 4 Jun 2015 16:13:18 +0200
4 Subject: [PATCH] workaround a linking problem on windows
6 Linking scfiltlo.dll gives the following error:
8 xmlcontext.o : error LNK2019: unresolved external symbol "char const * const orcus::XMLNS_UNKNOWN_ID" (?XMLNS_UNKNOWN_ID@orcus@@3QBDB) referenced in function "void __cdecl std::_For_each<unsigned int const *,class `anonymous namespace'::SetNamespaceAlias>(unsigned int const *,unsigned int const *,class `anonymous namespace'::SetNamespaceAlias &)" (??$_For_each@PBIVSetNamespaceAlias@?A0xafb5dd33@@@std@@YAXPBI0AAVSetNamespaceAlias@?A0xafb5dd33@@@Z)
9 C:/cygwin/home/tdf/lode/jenkins/workspace/lo_gerrit_master/Gerrit/Gerrit/Platform/Windows/instdir/program/scfiltlo.dll : fatal error LNK1120: 1 unresolved externals
11 I have got no idea what is the cause of this: the constant--exported in
12 liborcus-parser.dll--is used in liborus.dll without any problem.
14 include/orcus/types.hpp | 2 +-
15 src/parser/types.cpp | 1 -
16 2 files changed, 1 insertion(+), 2 deletions(-)
18 diff --git a/include/orcus/types.hpp b/include/orcus/types.hpp
19 index b6e3f83..8027f25 100644
20 --- a/include/orcus/types.hpp
21 +++ b/include/orcus/types.hpp
22 @@ -21,7 +21,7 @@ namespace orcus {
23 typedef size_t xml_token_t;
24 typedef const char* xmlns_id_t;
26 -ORCUS_PSR_DLLPUBLIC extern const xmlns_id_t XMLNS_UNKNOWN_ID;
27 +const xmlns_id_t XMLNS_UNKNOWN_ID = nullptr;
28 ORCUS_PSR_DLLPUBLIC extern const xml_token_t XML_UNKNOWN_TOKEN;
29 ORCUS_PSR_DLLPUBLIC extern const size_t index_not_found;
30 ORCUS_PSR_DLLPUBLIC extern const size_t unspecified;
31 diff --git a/src/parser/types.cpp b/src/parser/types.cpp
32 index be4e304..0a1b4a7 100644
33 --- a/src/parser/types.cpp
34 +++ b/src/parser/types.cpp
39 -const xmlns_id_t XMLNS_UNKNOWN_ID = nullptr;
40 const xml_token_t XML_UNKNOWN_TOKEN = 0;
42 const size_t index_not_found = std::numeric_limits<size_t>::max();