nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 36 lines 1.2 kB view raw
1diff -ur a/exp_win.c b/exp_win.c 2--- a/exp_win.c 2018-02-02 14:15:52.000000000 -0500 3+++ b/exp_win.c 2023-10-10 07:47:33.082690432 -0400 4@@ -39,7 +39,8 @@ 5 /* Sigh. On AIX 2.3, termios.h exists but does not define TIOCGWINSZ */ 6 /* Instead, it has to come from ioctl.h. However, As I said above, this */ 7 /* can't be cavalierly included on all machines, even when it exists. */ 8-#if defined(HAVE_TERMIOS) && !defined(HAVE_TIOCGWINSZ_IN_TERMIOS_H) 9+/* Darwin also has termios.h, but it requires ioctl.h for `ioctl`. */ 10+#if defined(HAVE_TERMIOS) && (defined(__APPLE__) || !defined(HAVE_TIOCGWINSZ_IN_TERMIOS_H)) 11 # include <sys/ioctl.h> 12 #endif 13 14diff -ur d/pty_termios.c c/pty_termios.c 15--- d/pty_termios.c 2023-10-10 07:59:23.244452442 -0400 16+++ c/pty_termios.c 2023-10-10 08:00:35.303231582 -0400 17@@ -7,7 +7,18 @@ 18 19 */ 20 21-#include <pty.h> /* openpty */ 22+/* openpty */ 23+#if defined(__APPLE__) 24+# include <util.h> 25+#elif defined(__FreeBSD__) 26+# include <sys/types.h> 27+# include <sys/ioctl.h> 28+# include <termios.h> 29+# include <libutil.h> 30+#else /* pty.h is Linux-specific */ 31+# include <pty.h> 32+#endif 33+ 34 #include <stdio.h> 35 #include <signal.h> 36