From 168b03405513fd4556ac3434f74867f26bd0431c Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Sat, 25 Oct 2014 23:04:35 +0000 Subject: [PATCH] Update select extension --- mkfile | 16 ++++++++++++---- select.c | 4 ++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/mkfile b/mkfile index 47c1806..b1ef8c4 100644 --- a/mkfile +++ b/mkfile @@ -1,5 +1,13 @@ CFLAGS = -g -Wall -fPIC --std=c99 -CPPFLAGS = -I/usr/include/awk -I. -DHAVE_CONFIG_H + +CPPFLAGS = -I/usr/include/awk \ + -DDYNAMIC \ + -DHAVE_VPRINTF \ + -DHAVE_STDARG_H \ + -DHAVE_STDBOOL_H \ + -DHAVE_STDDEF_H + +default: select.so test:Q: rm -f var/sp_cur.json @@ -13,10 +21,10 @@ test:Q: -e 's/^ < :\([^!]*\)![^ ]* PRIVMSG #\w* :/\1:\t/ ' test-select:Q: select.so - #awk -f select.awk + awk -f select.awk %.so: %.o gcc $CFLAGS -shared -o $target $prereq $LDFLAGS -%.o: %.c - gcc $CPPFLAGS $CFLAGS -c -o $target $prereq +%.o: %.c mkfile config.h + gcc $CPPFLAGS $CFLAGS -c -o $target $stem.c diff --git a/select.c b/select.c index d379167..b3ead6e 100644 --- a/select.c +++ b/select.c @@ -20,7 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "awk.h" +#include int plugin_is_GPL_compatible; @@ -43,7 +43,7 @@ static NODE *do_select(int nargs) if (!strcmp("any", how->stptr)) read = write = except = 1; if (!read && !write && !except) { printf("select: invalid select type: %.*s\n", - how->stlen, how->stptr); + (int)how->stlen, how->stptr); return make_number((AWKNUM) -EINVAL); } -- 2.43.2