From fa64d17c2f0db4e7d7512fa9cc964c405e692281 Mon Sep 17 00:00:00 2001 From: Rene Hexel Date: Sun, 5 May 2024 06:25:24 +1000 Subject: [PATCH] Make this compile under aarch64-linux --- Sources/CGLib/glib_bridging.h | 10 +++++++++- Sources/GLib/GLib.swift | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Sources/CGLib/glib_bridging.h b/Sources/CGLib/glib_bridging.h index 9c2dce22..3219913d 100644 --- a/Sources/CGLib/glib_bridging.h +++ b/Sources/CGLib/glib_bridging.h @@ -1,12 +1,20 @@ #ifdef __linux__ #include #include -extern int g_open (const char *, int, ...) __nonnull ((1)); +#ifdef __aarch64__ +extern int g_open(const char *, int, int) __nonnull ((1)); +#define g_open g_open_orig +#else +extern int g_open(const char *, int, ...) __nonnull ((1)); +#endif #endif #define __GLIB_H_INSIDE__ #include #include #undef __GLIB_H_INSIDE__ +#if defined(__linux__) && defined(__aarch64__) +#undef g_open +#endif struct _GAllocator {}; struct _GAsyncQueue {}; diff --git a/Sources/GLib/GLib.swift b/Sources/GLib/GLib.swift index 7bb82ef5..8d7cdc09 100644 --- a/Sources/GLib/GLib.swift +++ b/Sources/GLib/GLib.swift @@ -390,3 +390,18 @@ public func g_utime(_ path: UnsafePointer, _ times: UnsafePointer) -> CInt { + g_set_prgname(name) + return 0 +} +#endif \ No newline at end of file