diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-01-18 01:18:48 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-01-18 01:18:48 +0100 |
commit | 94421639b0bb61dc14ea39028ee66c84e26814a7 (patch) | |
tree | 7e3bb3c4615be49a081c6679996ad24279f4a78d /src | |
parent | 77cc3a7ffd430486e856788dd89842b05712b927 (diff) |
Add optional PCRE support
Diffstat (limited to 'src')
-rw-r--r-- | src/grab.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -3,7 +3,6 @@ #include <libgen.h> #include <limits.h> #include <locale.h> -#include <regex.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -14,12 +13,17 @@ # define nullptr NULL #endif -#include "da.h" - -#ifndef REG_STARTEND -# error "REG_STARTEND not defined" +#if GRAB_DO_PCRE +# include <pcre2posix.h> +#else +# include <regex.h> +# ifndef REG_STARTEND +# error "REG_STARTEND not defined" +# endif #endif +#include "da.h" + #define die(...) err(EXIT_FAILURE, __VA_ARGS__); #define diex(...) errx(EXIT_FAILURE, __VA_ARGS__); #define warn(...) \ |