From b34039ab34b27941f87002205a1cde187e46b20e Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Fri, 16 Feb 2018 09:13:12 +1000 Subject: [PATCH] Guard inclusion of stringbuf.h This allows for creation of a single-file to deliver linenoise support: cat stringbuf.h stringbuf.c utf8.h utf8.c linenoise.c >linenoise-ship.c Signed-off-by: Steve Bennett --- linenoise.c | 2 ++ stringbuf.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/linenoise.c b/linenoise.c index d04ec6c..f9f8e13 100644 --- a/linenoise.c +++ b/linenoise.c @@ -142,7 +142,9 @@ #include #include "linenoise.h" +#ifndef STRINGBUF_H #include "stringbuf.h" +#endif #include "utf8.h" #define LINENOISE_DEFAULT_HISTORY_MAX_LEN 100 diff --git a/stringbuf.c b/stringbuf.c index acac04c..b42a9cc 100644 --- a/stringbuf.c +++ b/stringbuf.c @@ -4,7 +4,9 @@ #include #include +#ifndef STRINGBUF_H #include "stringbuf.h" +#endif #ifdef USE_UTF8 #include "utf8.h" #endif -- 2.44.0