diff --git a/Sources/CGLib/glib_bridging.h b/Sources/CGLib/glib_bridging.h index 107e733e..9c2dce22 100644 --- a/Sources/CGLib/glib_bridging.h +++ b/Sources/CGLib/glib_bridging.h @@ -1,3 +1,8 @@ +#ifdef __linux__ +#include +#include +extern int g_open (const char *, int, ...) __nonnull ((1)); +#endif #define __GLIB_H_INSIDE__ #include #include diff --git a/Sources/GLib/GLib.swift b/Sources/GLib/GLib.swift index d531732f..7bb82ef5 100644 --- a/Sources/GLib/GLib.swift +++ b/Sources/GLib/GLib.swift @@ -318,6 +318,7 @@ public func g_mkdir(_ path: UnsafePointer, _ mode: gint) -> CInt { return mkdir(path, mode_t(mode)) } +#if os(macOS) /// Open a file. /// /// This function is a wrapper around the `open()` system call, @@ -332,6 +333,7 @@ public func g_mkdir(_ path: UnsafePointer, _ mode: gint) -> CInt { public func g_open(_ path: UnsafePointer, _ flags: CInt, _ mode: gint = 0) -> CInt { return open(path, flags, mode_t(mode)) } +#endif /// Remove a filesystem object. ///