Fix compilation on Free and OpenBSD.
authorMarc Andre Tanner <mat@brain-dump.org>
Sat, 29 Dec 2007 18:13:21 +0000 (19:13 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sat, 29 Dec 2007 18:13:29 +0000 (19:13 +0100)
Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
madtty/madtty.c

index af12870..95ea5e2 100644 (file)
@@ -24,7 +24,6 @@
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <pty.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/types.h>
 #include <termios.h>
 #include <wchar.h>
-
+#ifdef __linux__
+# include <pty.h>
+#elif defined(__FreeBSD__)
+# include <libutil.h>
+#elif defined(__OpenBSD__)
+# include <util.h>
+#endif
 #include "madtty.h"
 
+#ifndef NCURSES_ATTR_SHIFT
+# define NCURSES_ATTR_SHIFT 8
+#endif
+
 #define IS_CONTROL(ch) !((ch) & 0xffffff60UL)
 
 static int has_default = 0;