diff --git a/Android.bp b/Android.bp index 9ab8145..f7d1db8 100644 --- a/Android.bp +++ b/Android.bp @@ -332,3 +332,11 @@ cc_library { ], vendor_available: true, } + +cc_library_shared { + name: "libtinyxml2_shim", + srcs: ["libtinyxml2/XMLDocument.cpp"], + shared_libs: ["libtinyxml2"], + system_ext_specific: true, + vendor_available: true, +} diff --git a/libtinyxml2/XMLDocument.cpp b/libtinyxml2/XMLDocument.cpp new file mode 100644 index 0000000..17d3dc9 --- /dev/null +++ b/libtinyxml2/XMLDocument.cpp @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +namespace tinyxml2 { + +extern "C" { +void* _ZN8tinyxml211XMLDocumentC1Eb(XMLDocument* thisptr, bool processEntities) { + return new (thisptr) XMLDocument(processEntities); +} + +XMLError _ZN8tinyxml211XMLDocument8SaveFileEPKc(XMLDocument* thisptr, const char* filename) { + return thisptr->SaveFile(filename); +} +} + +} // namespace tinyxml2