From 5c54e69ef00d1bc356f5f703338b63032e9e75c0 Mon Sep 17 00:00:00 2001 From: Sebastiano Barezzi Date: Tue, 18 Jul 2023 11:37:28 +0200 Subject: [PATCH] compat: Add libtinyxml2 shim Change-Id: I2bc7963086f7f5df453e135819ed8b28c4d6a0d5 --- Android.bp | 8 ++++++++ libtinyxml2/XMLDocument.cpp | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 libtinyxml2/XMLDocument.cpp 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