From 5ef06a24660caf210f94e7305ce34191778f5c5b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 22 Mar 2026 20:08:14 +0100 Subject: [PATCH] Fix build with musl --- src/ClipboardFile.cpp | 6 +++--- src/GlobalHotkeys/GlobalHotkeysLinux.cpp | 2 +- src/Overlay.cpp | 1 + src/gui/FileChooser.cpp | 3 ++- src/main.cpp | 1 + 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ClipboardFile.cpp b/src/ClipboardFile.cpp index 1a48cec..e2b35e9 100644 --- a/src/ClipboardFile.cpp +++ b/src/ClipboardFile.cpp @@ -300,8 +300,8 @@ namespace gsr { return; } - struct stat64 stat; - if(fstat64(file_fd, &stat) == -1) { + struct stat stat; + if(fstat(file_fd, &stat) == -1) { fprintf(stderr, "gsr ui: error: ClipboardFile::set_current_file: failed to get file size for file %s, error: %s\n", filepath.c_str(), strerror(errno)); close(file_fd); file_fd = -1; @@ -313,4 +313,4 @@ namespace gsr { XSetSelectionOwner(dpy, clipboard_atom, clipboard_window, CurrentTime); XFlush(dpy); } -} \ No newline at end of file +} diff --git a/src/GlobalHotkeys/GlobalHotkeysLinux.cpp b/src/GlobalHotkeys/GlobalHotkeysLinux.cpp index c6b9b82..83192e5 100644 --- a/src/GlobalHotkeys/GlobalHotkeysLinux.cpp +++ b/src/GlobalHotkeys/GlobalHotkeysLinux.cpp @@ -3,7 +3,7 @@ #include #include #include - +#include extern "C" { #include } diff --git a/src/Overlay.cpp b/src/Overlay.cpp index 19a9789..f474195 100644 --- a/src/Overlay.cpp +++ b/src/Overlay.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include diff --git a/src/gui/FileChooser.cpp b/src/gui/FileChooser.cpp index ceb8c94..6081109 100644 --- a/src/gui/FileChooser.cpp +++ b/src/gui/FileChooser.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -296,4 +297,4 @@ namespace gsr { const std::string& FileChooser::get_current_directory() const { return current_directory_text.get_string(); } -} \ No newline at end of file +} diff --git a/src/main.cpp b/src/main.cpp index d3490d7..78d54c5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include