Introduction
Introduction Statistics Contact Development Disclaimer Help
separate JSON2TSV_* CFLAGS, LDFLAGS, use unlocked I/O by default - json2tsv - J…
git clone git://git.codemadness.org/json2tsv
Log
Files
Refs
README
LICENSE
---
commit 770996c13b04532dacf3a190f57dd0c06ed4e7a7
parent 917726e20fb722b0097e5be8a2f68ba385c58d66
Author: Hiltjo Posthuma <[email protected]>
Date: Thu, 29 Apr 2021 12:57:45 +0200
separate JSON2TSV_* CFLAGS, LDFLAGS, use unlocked I/O by default
Diffstat:
M Makefile | 12 ++++++++++--
M json.c | 4 +++-
2 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/Makefile b/Makefile
@@ -10,6 +10,14 @@ DOCPREFIX = ${PREFIX}/share/doc/${NAME}
RANLIB = ranlib
+# use system flags.
+JSON2TSV_CFLAGS = ${CFLAGS}
+JSON2TSV_LDFLAGS = ${LDFLAGS}
+JSON2TSV_CPPFLAGS = -D_DEFAULT_SOURCE
+
+# uncomment for conservative locked I/O.
+#JSON2TSV_CPPFLAGS = -D_DEFAULT_SOURCE -DGETNEXT=getchar
+
BIN = ${NAME}
SRC = ${BIN:=.c}
HDR = json.h
@@ -33,10 +41,10 @@ OBJ = ${SRC:.c=.o} ${LIBJSONOBJ}
${OBJ}: ${HDR}
.o:
- ${CC} ${LDFLAGS} -o $@ $< ${LIB}
+ ${CC} ${JSON2TSV_LDFLAGS} -o $@ $< ${LIB}
.c.o:
- ${CC} ${CFLAGS} ${CPPFLAGS} -o $@ -c $<
+ ${CC} ${JSON2TSV_CFLAGS} ${JSON2TSV_CPPFLAGS} -o $@ -c $<
${LIBJSON}: ${LIBJSONOBJ}
${AR} -rc $@ $?
diff --git a/json.c b/json.c
@@ -5,7 +5,9 @@
#include <stdlib.h>
#include <string.h>
-#define GETNEXT getchar
+#ifndef GETNEXT
+#define GETNEXT getchar_unlocked
+#endif
#include "json.h"
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.