diff --git a/cmake.config/CMakeLists.txt b/cmake.config/CMakeLists.txt index aac8c4c27b..bc0a9f4ccd 100644 --- a/cmake.config/CMakeLists.txt +++ b/cmake.config/CMakeLists.txt @@ -91,7 +91,7 @@ int main(void) } " HAVE_BITSCANFORWARD64) -if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") +if(CMAKE_SYSTEM_NAME STREQUAL "SunOS" OR CMAKE_SYSTEM_NAME STREQUAL "Haiku") check_c_source_compiles(" #include int diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index b6d49b8d4a..6d88de3dc6 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -93,7 +93,7 @@ if(NOT MSVC) endif() # -fstack-protector breaks Mingw-w64 builds -if(NOT MINGW) +if(NOT MINGW AND NOT CMAKE_SYSTEM_NAME STREQUAL "Haiku") check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG) if(HAS_FSTACK_PROTECTOR_STRONG_FLAG) target_compile_options(main_lib INTERFACE -fstack-protector-strong) @@ -145,7 +145,10 @@ endif() # Platform specific options if(UNIX) target_link_libraries(main_lib INTERFACE m) - if (NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS") + if (CMAKE_SYSTEM_NAME STREQUAL "Haiku") + target_link_libraries(main_lib INTERFACE bsd) + target_link_libraries(nvim_bin PRIVATE -lnetwork) + elseif (NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS") target_link_libraries(main_lib INTERFACE util) endif() endif() diff --git a/src/nvim/os/pty_proc_unix.c b/src/nvim/os/pty_proc_unix.c index 10a464bbc3..1f902130d5 100644 --- a/src/nvim/os/pty_proc_unix.c +++ b/src/nvim/os/pty_proc_unix.c @@ -46,12 +46,17 @@ # include "os/pty_proc_unix.c.generated.h" #endif -#if defined(__sun) && !defined(HAVE_FORKPTY) +#if !defined(HAVE_FORKPTY) && !defined(__APPLE__) // this header defines STR, just as nvim.h, but it is defined as ('S'<<8), // to avoid #undef STR, #undef STR, #define STR ('S'<<8) just delay the // inclusion of the header even though it gets include out of order. -# include + +# if !defined(__HAIKU__) +# include +# else +# define I_PUSH 0 // XXX: find the actual value +# endif static int openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize *winp) @@ -343,9 +348,11 @@ static void init_termios(struct termios *termios) FUNC_ATTR_NONNULL_ALL termios->c_cc[VSTART] = 0x1f & 'Q'; termios->c_cc[VSTOP] = 0x1f & 'S'; termios->c_cc[VSUSP] = 0x1f & 'Z'; +#if !defined(__HAIKU__) termios->c_cc[VREPRINT] = 0x1f & 'R'; termios->c_cc[VWERASE] = 0x1f & 'W'; termios->c_cc[VLNEXT] = 0x1f & 'V'; +#endif termios->c_cc[VMIN] = 1; termios->c_cc[VTIME] = 0; }