From 54c8189ed2943a26c92039f86bbeacd9a6fdc43f Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 13 Aug 2021 15:08:10 -0400 Subject: [PATCH 1/2] fix msys2 build for real --- CMakeLists.txt | 1 + src/compat/compat.h | 1 + src/lib/linux.c | 5 ++++- src/ls/main.cpp | 1 + src/poc/fileroller.c | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 738d1cb37..9da7a7369 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -612,6 +612,7 @@ add_executable(ncls ${LSSRC}) target_include_directories(ncls PRIVATE include + src "${CMAKE_REQUIRED_INCLUDES}" "${PROJECT_BINARY_DIR}/include" ) diff --git a/src/compat/compat.h b/src/compat/compat.h index bff884d69..e85c75c7d 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -38,6 +38,7 @@ extern "C" { typedef struct siginfo_t { int aieeee; } siginfo_t; +#define sigemptyset(s) 0 #define sigset_t int #define nl_langinfo(x) "UTF-8" #define ppoll(w, x, y, z) WSAPoll((w), (x), (y)) diff --git a/src/lib/linux.c b/src/lib/linux.c index 5402fcd18..c97b69f09 100644 --- a/src/lib/linux.c +++ b/src/lib/linux.c @@ -120,7 +120,10 @@ error: } int fbcon_scrub(const struct ncpile* p, sprixel* s){ - return sixel_scrub(p, s); + (void)p; + (void)s; + return 0; + //return sixel_scrub(p, s); } #ifdef __linux__ diff --git a/src/ls/main.cpp b/src/ls/main.cpp index 275edcefb..e9cd90793 100644 --- a/src/ls/main.cpp +++ b/src/ls/main.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #ifndef __linux__ #define AT_NO_AUTOMOUNT 0 // not defined on freebsd diff --git a/src/poc/fileroller.c b/src/poc/fileroller.c index 3f995e68a..24ee90113 100644 --- a/src/poc/fileroller.c +++ b/src/poc/fileroller.c @@ -4,6 +4,7 @@ #include #include #include +#include #include static bool fddone; From 7c9163d5a1e269138f40151fe9a27487f58484d0 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 13 Aug 2021 15:11:38 -0400 Subject: [PATCH 2/2] GetExitCodeProcess: kill compiler error --- src/compat/compat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compat/compat.c b/src/compat/compat.c index 572ed451f..9c0d1feb4 100644 --- a/src/compat/compat.c +++ b/src/compat/compat.c @@ -28,7 +28,9 @@ int set_fd_nonblocking(int fd, unsigned state, unsigned* oldstate){ // FIXME pid_t waitpid(pid_t pid, int* state, int options){ (void)options; // FIXME honor WNOHANG WaitForSingleObject(pid, INFINITE); - GetExitCodeProcess(pid, state); + long unsigned pstate; + GetExitCodeProcess(pid, &pstate); + *state = pstate; CloseHandle(pid); return pid; }