Commit: 9e33e5cc236b2fbfc78f504ef577249484fd0b0b
Parent: bc8952e3e5ef62a01c8df8cfc97833aeb88f7f8f
Author: Randy Palamar
Date: Fri, 6 Dec 2024 10:06:14 -0700
work around indirect libc include by broken gcc headers
Diffstat:
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/platform_linux_amd64.c b/platform_linux_amd64.c
@@ -44,7 +44,7 @@ typedef __attribute__((aligned(16))) u8 stat_buffer[144];
#define STAT_INODE(sb) STAT_BUF_MEMBER(sb, i64, 8)
#define STAT_FILE_SIZE(sb) STAT_BUF_MEMBER(sb, i64, 48)
-typedef u64 fd_set[16];
+typedef u64 sys_fd_set[16];
#define DIRENT_RECLEN_OFF 16
#define DIRENT_TYPE_OFF 18
diff --git a/platform_linux_common.c b/platform_linux_common.c
@@ -35,6 +35,11 @@
#define WNOHANG 1
#define W_IF_EXITED(s) (!((s) & 0x7F))
+/* TODO: glibc/gcc indirectly include sys/select.h if you include immintrin.h. If that
+ * header is removed this can also be removed */
+#undef FD_SET
+#undef FD_ISSET
+
#define FD_SET(d, s) ((s)[(d) / (8 * sizeof(*(s)))] |= (1ULL << ((d) % (8 * sizeof(*(s))))))
#define FD_ISSET(d, s) ((s)[(d) / (8 * sizeof(*(s)))] & (1ULL << ((d) % (8 * sizeof(*(s))))))
diff --git a/platform_linux_x11.c b/platform_linux_x11.c
@@ -266,7 +266,7 @@ update_input(PlatformCtx *ctx)
input->pending_updates = 0;
}
- fd_set rfd = {0};
+ sys_fd_set rfd = {0};
FD_SET(ctx->child.handle, rfd);
FD_SET(ctx->inotify_fd, rfd);
FD_SET(ctx->win_fd, rfd);