From 05fed651a95514a57bdaa1fc549e7d9443145df3 Mon Sep 17 00:00:00 2001 From: Matthew Wesley Date: Sat, 27 Aug 2022 20:47:26 -0700 Subject: [PATCH] Make CONFIGATOR_MAX_LINES overrideable. Wrap the CONFIGATOR_MAX_LINES preprocessor macro definition with #ifndef. Add an EXTRAFLAGS makefile variable. Now, `make EXTRAFLAGS=-DCONFIGATOR_MAX_LINE=999` can override the default line limit. --- makefile | 1 + src/configator.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/makefile b/makefile index 0ca9ee1..8ac4243 100644 --- a/makefile +++ b/makefile @@ -2,6 +2,7 @@ NAME = sample CC = gcc FLAGS = -std=c99 -pedantic -g FLAGS+= -Wall -Wno-unused-parameter -Wextra -Werror=vla -Werror +FLAGS+= $(EXTRAFLAGS) VALGRIND = --show-leak-kinds=all --track-origins=yes --leak-check=full BIND = bin diff --git a/src/configator.h b/src/configator.h index 58a7121..d05a3f8 100644 --- a/src/configator.h +++ b/src/configator.h @@ -3,7 +3,9 @@ #include +#ifndef CONFIGATOR_MAX_LINE #define CONFIGATOR_MAX_LINE 80 +#endif #if 0 #define CONFIGATOR_DEBUG