From bb301bfb0fec3d5e229367aca74cfe422c23f62c Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Mon, 4 Nov 2019 20:52:27 -0800 Subject: Move configured regex lib in to a common header diff --git a/cmd2.c b/cmd2.c index 2d8ab53..dbd264a 100644 --- a/cmd2.c +++ b/cmd2.c @@ -26,17 +26,12 @@ #include #include -#ifdef USE_PCREPOSIX -# include -#elif defined(USE_REGEXP) -# include -#endif - int strcasecmp(); int select(); #include "defines.h" #include "main.h" +#include "feature/regex.h" #include "utils.h" #include "beam.h" #include "edit.h" diff --git a/feature/regex.h b/feature/regex.h new file mode 100644 index 0000000..d630b99 --- /dev/null +++ b/feature/regex.h @@ -0,0 +1,11 @@ +#ifndef _FEATURE_REGEX_H_ +#define _FEATURE_REGEX_H_ + +#ifdef USE_REGEXP_PCREPOSIX +# include +#elif defined(USE_REGEXP) +# include +# include +#endif + +#endif /* _FEATURE_REGEX_H_ */ diff --git a/list.c b/list.c index 1bb0a65..2652bda 100644 --- a/list.c +++ b/list.c @@ -18,14 +18,9 @@ #include #include -#ifdef USE_PCREPOSIX -# include -#elif defined(USE_REGEXP) -# include -#endif - #include "defines.h" #include "main.h" +#include "feature/regex.h" #include "utils.h" #include "cmd2.h" #include "tty.h" diff --git a/main.c b/main.c index e92d2ea..28d1592 100644 --- a/main.c +++ b/main.c @@ -75,14 +75,9 @@ extern int errno; extern int select(); -#ifdef USE_PCREPOSIX -# include -#elif defined(USE_REGEXP) -# include -#endif - #include "defines.h" #include "main.h" +#include "feature/regex.h" #include "utils.h" #include "beam.h" #include "cmd.h" @@ -435,12 +430,15 @@ void printver(void) " termios," #endif #ifdef USE_REGEXP - " regexp," + " regexp " + #ifdef USE_REGEXP_PCREPOSIX + "(pcreposix)" + #else + "(libc)" + #endif + "," #else - " no regexp," -#endif -#ifdef USE_PCREPOSIX - " pcreposix," + " no regexp," #endif #ifdef USE_LOCALE " locale," -- cgit v0.10.2