termux-packages/packages/aapt/libbase-properties.cpp.patch

48 lines
1.1 KiB
Diff
Raw Normal View History

2022-02-07 12:53:59 +01:00
--- a/libbase/properties.cpp
+++ b/libbase/properties.cpp
@@ -32,7 +32,7 @@
#include <android-base/parseint.h>
#include <android-base/strings.h>
2022-02-06 13:20:18 +01:00
-#if !defined(__BIONIC__)
+#if !defined(__BIONIC__) || defined(__TERMUX__)
2022-02-07 12:53:59 +01:00
#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 @@
2022-02-06 13:20:18 +01:00
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;
2022-02-07 12:53:59 +01:00
@@ -134,7 +136,7 @@
2022-02-06 13:20:18 +01:00
return (__system_property_set(key.c_str(), value.c_str()) == 0);
}
-#if defined(__BIONIC__)
+#if defined(__BIONIC__) && !defined(__TERMUX__)
struct WaitForPropertyData {
bool done;