compat: Add libtinyxml2 shim

Change-Id: I2bc7963086f7f5df453e135819ed8b28c4d6a0d5
This commit is contained in:
Sebastiano Barezzi 2023-07-18 11:37:28 +02:00
parent 844cbbb2d3
commit 5c54e69ef0
No known key found for this signature in database
GPG key ID: 763BD3AE91A7A13F
2 changed files with 30 additions and 0 deletions

View file

@ -332,3 +332,11 @@ cc_library {
], ],
vendor_available: true, vendor_available: true,
} }
cc_library_shared {
name: "libtinyxml2_shim",
srcs: ["libtinyxml2/XMLDocument.cpp"],
shared_libs: ["libtinyxml2"],
system_ext_specific: true,
vendor_available: true,
}

View file

@ -0,0 +1,22 @@
/*
* Copyright (C) 2023 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <tinyxml2.h>
#include <new>
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