Fix build on Solaris (and hopefully OpenIndiana)

* memset/memzero needs cstring/string.h (again)
 * winsize_t requires an impl from <sys/termios.h>

With this patch, I was able to get fish master to build on Solaris 11.4
without any additional dependencies (after installing gcc 7, git, and
cmake). I think the ncurses dependency can be dropped from the
OpenIndiana package?
This commit is contained in:
Mahmoud Al-Qudsi 2021-02-23 11:01:41 -06:00
parent d95e99f2d4
commit ffa24eb361
2 changed files with 7 additions and 3 deletions

View file

@ -8,12 +8,12 @@
#include <fcntl.h>
#include <unistd.h>
#include <cstring>
#include "common.h"
#include "flog.h"
#include "wutil.h"
#include <fcntl.h>
#ifdef HAVE_EVENTFD
#include <sys/eventfd.h>
#endif

View file

@ -7,6 +7,10 @@
#include "wcstringutil.h"
#include "wutil.h"
#ifdef HAVE_WINSIZE
#include <sys/termios.h>
#endif
// A counter which is incremented every SIGWINCH, or when the tty is otherwise invalidated.
static volatile uint32_t s_tty_termsize_gen_count{0};
@ -25,7 +29,7 @@ static maybe_t<termsize_t> read_termsize_from_tty() {
FLOGF(term_support, L"Terminal has 0 rows, falling back to default height");
winsize.ws_row = termsize_t::DEFAULT_HEIGHT;
}
result = termsize_t{winsize.ws_col, winsize.ws_row};
result = termsize_t(winsize.ws_col, winsize.ws_row);
}
#endif
return result;