Fix build with musl

This commit is contained in:
dec05eba
2026-03-22 20:08:14 +01:00
parent c3e9aa0f81
commit 5ef06a2466
5 changed files with 8 additions and 5 deletions

View File

@@ -300,8 +300,8 @@ namespace gsr {
return; return;
} }
struct stat64 stat; struct stat stat;
if(fstat64(file_fd, &stat) == -1) { 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)); 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); close(file_fd);
file_fd = -1; file_fd = -1;
@@ -313,4 +313,4 @@ namespace gsr {
XSetSelectionOwner(dpy, clipboard_atom, clipboard_window, CurrentTime); XSetSelectionOwner(dpy, clipboard_atom, clipboard_window, CurrentTime);
XFlush(dpy); XFlush(dpy);
} }
} }

View File

@@ -3,7 +3,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <limits.h> #include <limits.h>
#include <string.h> #include <string.h>
#include <unistd.h>
extern "C" { extern "C" {
#include <mgl/mgl.h> #include <mgl/mgl.h>
} }

View File

@@ -32,6 +32,7 @@
#include <algorithm> #include <algorithm>
#include <inttypes.h> #include <inttypes.h>
#include <math.h> #include <math.h>
#include <unistd.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>

View File

@@ -9,6 +9,7 @@
#include <mglpp/window/Event.hpp> #include <mglpp/window/Event.hpp>
#include <mglpp/system/FloatRect.hpp> #include <mglpp/system/FloatRect.hpp>
#include <limits.h>
#include <dirent.h> #include <dirent.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h> #include <errno.h>
@@ -296,4 +297,4 @@ namespace gsr {
const std::string& FileChooser::get_current_directory() const { const std::string& FileChooser::get_current_directory() const {
return current_directory_text.get_string(); return current_directory_text.get_string();
} }
} }

View File

@@ -10,6 +10,7 @@
#include <string.h> #include <string.h>
#include <limits.h> #include <limits.h>
#include <malloc.h> #include <malloc.h>
#include <unistd.h>
#include <mglpp/mglpp.hpp> #include <mglpp/mglpp.hpp>
#include <mglpp/system/Clock.hpp> #include <mglpp/system/Clock.hpp>