0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-09-22 08:31:32 +00:00
termux-packages/x11-packages/libneatvnc/0002-aligned_alloc.patch
2023-10-20 03:20:08 +08:00

19 lines
484 B
Diff

--- a/src/fb.c
+++ b/src/fb.c
@@ -33,6 +33,15 @@
#define ALIGN_UP(n, a) (UDIV_UP(n, a) * a)
#define EXPORT __attribute__((visibility("default")))
+#if defined(__ANDROID__) && __ANDROID_API__ < 26
+void *aligned_alloc(size_t align, size_t size)
+{
+ void *result = NULL;
+ posix_memalign(&result, align, size);
+ return result;
+}
+#endif
+
EXPORT
struct nvnc_fb* nvnc_fb_new(uint16_t width, uint16_t height,
uint32_t fourcc_format, uint16_t stride)