mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-05 11:30:47 -05:00
Fix host build compatibility with GCC
Fix compilation errors when building host binaries (such as magiskboot) using GCC on Linux: - Define _GNU_SOURCE in base and boot build.rs for glibc extensions. - Add missing <cstdarg>, <cstring>, and <memory> standard headers. - Provide a fallback definition for __printflike on glibc. - Implement portable strscpy without relying on BSD strlcpy. - Add unwrap_ref in bootimg.hpp to allow binding references to packed struct members under GCC. - Remove cxx_impl_annotations in codegen.rs to prevent always_inline from being emitted on header declarations without function bodies. Assisted-by: Gemini 3.8 Flash
This commit is contained in:
@@ -5,10 +5,17 @@
|
||||
#include <dirent.h>
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
#include <cstdarg>
|
||||
#include <cstring>
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
|
||||
#include <rust/cxx.h>
|
||||
|
||||
#ifndef __printflike
|
||||
#define __printflike(a, b) __attribute__((__format__(__printf__, a, b)))
|
||||
#endif
|
||||
|
||||
void LOGD(const char *fmt, ...) __printflike(1, 2);
|
||||
void LOGI(const char *fmt, ...) __printflike(1, 2);
|
||||
void LOGW(const char *fmt, ...) __printflike(1, 2);
|
||||
|
||||
Reference in New Issue
Block a user