croptool

Image cropping tool
git clone git://lumidify.org/croptool.git
Log | Files | Refs | README | LICENSE

commit 56441a91e73a4b1c9b75cf7c29aa6c0cc4ff54a8
parent c5c5ee818931792a57b3115d89790a4ace8a1d4a
Author: lumidify <nobody@lumidify.org>
Date:   Fri,  1 Jan 2021 22:30:02 +0100

Fix compilation

Diffstat:
MMakefile | 2+-
Mcroptool.c | 5++++-
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile @@ -10,7 +10,7 @@ BIN = ${NAME} SRC = ${BIN:=.c} MAN1 = ${BIN:=.1} -CFLAGS += `pkg-config --cflags x11` `imlib2-config --cflags` +CFLAGS += -D_POSIX_C_SOURCE=200809L `pkg-config --cflags x11` `imlib2-config --cflags` LDFLAGS += `pkg-config --libs x11` `imlib2-config --libs` -lm all: ${BIN} diff --git a/croptool.c b/croptool.c @@ -19,7 +19,7 @@ #include <errno.h> #include <string.h> #include <stdlib.h> -#include <stdlib.h> +#include <limits.h> #include <unistd.h> #include <X11/Xlib.h> #include <X11/Xutil.h> @@ -55,6 +55,9 @@ static short SELECTION_REDRAW = 1; */ static char *CMD_FORMAT = "mogrify -crop %wx%h+%l+%t '%f'"; +extern char *optarg; +extern int optind; + struct Rect { int x0; int y0;