scroll

scrollbackbuffer program for st
git clone git://git.suckless.org//gitrepos
Log | Files | Refs

commit be490d2fd4a1fbf2da5d0614fbfea4e659142e6d
parent 51365d26c1e3f2e7074ff863cae3dbe25d2a382b
Author: Jan Klemkow <j.klemkow@wemelug.de>
Date:   Sat,  4 Jan 2020 11:41:46 +0100

Merge pull request #1 from jspricke/linux

Adopt to Linux
Diffstat:
MMakefile | 5+++--
Mscroll.c | 12+++++++-----
2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,5 +1,6 @@ -CFLAGS = -std=c99 -pedantic -Wall -Wextra -LDFLAGS += -lutil +CFLAGS += -std=c99 -pedantic -Wall -Wextra +LDLIBS += -lutil +CPPFLAGS += -D_DEFAULT_SOURCE .PHONY: all clean diff --git a/scroll.c b/scroll.c @@ -1,5 +1,3 @@ -//#define _DEFAULT_SOURCE - #include <sys/types.h> #include <sys/ioctl.h> #include <sys/select.h> @@ -16,9 +14,13 @@ #include <termios.h> #include <unistd.h> -// TODO: OpenBSD/Linux ifdef -#include <util.h> -//#include <pty.h> +#if defined(__linux) + #include <pty.h> +#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) + #include <util.h> +#elif defined(__FreeBSD__) || defined(__DragonFly__) + #include <libutil.h> +#endif typedef struct Line Line; struct Line {