0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-12-12 14:13:36 +00:00
termux-packages/packages/aapt/libbase-properties.cpp.patch
2022-02-08 10:26:57 +09:00

48 lines
1.1 KiB
Diff

--- a/libbase/properties.cpp
+++ b/libbase/properties.cpp
@@ -32,7 +32,7 @@
#include <android-base/parseint.h>
#include <android-base/strings.h>
-#if !defined(__BIONIC__)
+#if !defined(__BIONIC__) || defined(__TERMUX__)
#define PROP_VALUE_MAX 92
@@ -53,6 +53,9 @@
return 0;
}
+#endif
+
+#if !defined(__BIONIC__)
int __system_property_get(const char* key, char* value) {
auto it = g_properties.find(key);
if (it == g_properties.end()) {
@@ -62,7 +65,6 @@
snprintf(value, PROP_VALUE_MAX, "%s", it->second.c_str());
return strlen(value);
}
-
#endif
namespace android {
@@ -108,7 +110,7 @@
std::string GetProperty(const std::string& key, const std::string& default_value) {
std::string property_value;
-#if defined(__BIONIC__)
+#if defined(__BIONIC__) && !defined(__TERMUX__)
const prop_info* pi = __system_property_find(key.c_str());
if (pi == nullptr) return default_value;
@@ -134,7 +136,7 @@
return (__system_property_set(key.c_str(), value.c_str()) == 0);
}
-#if defined(__BIONIC__)
+#if defined(__BIONIC__) && !defined(__TERMUX__)
struct WaitForPropertyData {
bool done;