tFix compilation - croptool - Image cropping tool
HTML git clone git://lumidify.org/croptool.git
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 56441a91e73a4b1c9b75cf7c29aa6c0cc4ff54a8
DIR parent c5c5ee818931792a57b3115d89790a4ace8a1d4a
HTML Author: lumidify <nobody@lumidify.org>
Date: Fri, 1 Jan 2021 22:30:02 +0100
Fix compilation
Diffstat:
M Makefile | 2 +-
M croptool.c | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
---
DIR diff --git a/Makefile b/Makefile
t@@ -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}
DIR diff --git a/croptool.c b/croptool.c
t@@ -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>
t@@ -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;