Skip to content

Instantly share code, notes, and snippets.

@svalaskevicius
Created December 16, 2012 20:57
Show Gist options
  • Save svalaskevicius/4312897 to your computer and use it in GitHub Desktop.
Save svalaskevicius/4312897 to your computer and use it in GitHub Desktop.
BDB XML on mac with clang and cpp11

Compiling BDBXML for clang and c++11

To be able to compile BDB XML with clang, there are some code changes to be implemented first - see the accompanying patch file.

patch -p2 < ~/bdbxml-clang.patch

./buildall.sh -m 'make -j6' \
--with-configure-env="CC=clang CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -lc++ -mmacosx-version-min=10.7 -Wno-c++11-narrowing' LDFLAGS='-stdlib=libc++ -lc++ -mmacosx-version-min=10.7'" \
--with-xerces-conf="--disable-network --without-curl" \
--with-xqilla-conf="--without-tidy"
diff -u -r orig/dbxml-2.5.16/dbxml/src/dbxml/nodeStore/NsUpdate.cpp patched/dbxml-2.5.16/dbxml/src/dbxml/nodeStore/NsUpdate.cpp
--- orig/dbxml-2.5.16/dbxml/src/dbxml/nodeStore/NsUpdate.cpp 2009-12-22 13:17:00.000000000 +0000
+++ patched/dbxml-2.5.16/dbxml/src/dbxml/nodeStore/NsUpdate.cpp 2012-12-16 20:02:11.000000000 +0000
@@ -1358,13 +1358,13 @@
void NsUpdate::attributeRemoved(const DbXmlNodeImpl &node)
{
string key = makeKey(node);
- attrMap_.insert(make_pair<const std::string, int>(key,node.getIndex()));
+ attrMap_.insert(make_pair(key,node.getIndex()));
}
void NsUpdate::textRemoved(const DbXmlNodeImpl &node)
{
string key = makeKey(node);
- textDeleteMap_.insert(make_pair<const std::string, int>(key,node.getIndex()));
+ textDeleteMap_.insert(make_pair(key,node.getIndex()));
}
void NsUpdate::textRemoved(int index, const NsNid &nid,
@@ -1372,13 +1372,13 @@
const std::string &cname)
{
string key = makeKey(nid, did, cname);
- textDeleteMap_.insert(make_pair<const std::string, int>(key,index));
+ textDeleteMap_.insert(make_pair(key,index));
}
void NsUpdate::textInserted(int index, const DbXmlNodeImpl &node)
{
string key = makeKey(node);
- textInsertMap_.insert(make_pair<const std::string, int>(key,index));
+ textInsertMap_.insert(make_pair(key,index));
}
void NsUpdate::textInserted(int index, const NsNid &nid,
@@ -1386,7 +1386,7 @@
const std::string &cname)
{
string key = makeKey(nid, did, cname);
- textInsertMap_.insert(make_pair<const std::string, int>(key,index));
+ textInsertMap_.insert(make_pair(key,index));
}
//
diff -u -r orig/dbxml-2.5.16/dbxml/src/dbxml/nodeStore/NsXercesTranscoder.cpp patched/dbxml-2.5.16/dbxml/src/dbxml/nodeStore/NsXercesTranscoder.cpp
--- orig/dbxml-2.5.16/dbxml/src/dbxml/nodeStore/NsXercesTranscoder.cpp 2009-12-22 13:17:00.000000000 +0000
+++ patched/dbxml-2.5.16/dbxml/src/dbxml/nodeStore/NsXercesTranscoder.cpp 2012-12-16 20:03:22.000000000 +0000
@@ -206,7 +206,7 @@
bool needsEscape = false;
if (!len)
len = NsUtil::nsStringLen(characters);
- enum checkType ttype = (isCDATA || ignorable) ? ignore : isCharacters;
+ enum checkType ttype = (isCDATA || ignorable) ? checkType::ignore : isCharacters;
NsDonator chars(characters, len, ttype);
uint32_t textType;
if (isCDATA)
diff -u -r orig/dbxml-2.5.16/xqilla/src/items/DatatypeFactoryTemplate.hpp patched/dbxml-2.5.16/xqilla/src/items/DatatypeFactoryTemplate.hpp
--- orig/dbxml-2.5.16/xqilla/src/items/DatatypeFactoryTemplate.hpp 2009-01-07 11:46:13.000000000 +0000
+++ patched/dbxml-2.5.16/xqilla/src/items/DatatypeFactoryTemplate.hpp 2012-12-02 18:16:03.000000000 +0000
@@ -79,7 +79,7 @@
AnyAtomicType::Ptr createInstance(const XMLCh* value,
const DynamicContext* context) const
{
- return createInstanceNoCheck(DatatypeFactoryTemplate<TYPE>::getPrimitiveTypeURI(),
+ return DatatypeFactoryTemplate<TYPE>::createInstanceNoCheck(DatatypeFactoryTemplate<TYPE>::getPrimitiveTypeURI(),
DatatypeFactoryTemplate<TYPE>::getPrimitiveTypeName(), value, context);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment