From ca043ea09f1070d490fba7b56fbb36e2e22da2b1 Mon Sep 17 00:00:00 2001 From: Qubitium Date: Thu, 9 Oct 2025 03:43:42 +0000 Subject: [PATCH] use system header first --- pcre_ext/pcre2_module.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pcre_ext/pcre2_module.h b/pcre_ext/pcre2_module.h index e4fd716..6df0af0 100644 --- a/pcre_ext/pcre2_module.h +++ b/pcre_ext/pcre2_module.h @@ -16,7 +16,18 @@ #if !defined(PCRE2_CODE_UNIT_WIDTH) #define PCRE2_CODE_UNIT_WIDTH 8 #endif -#include "pcre2.h" +#if defined(__has_include) +// Prefer the system-provided header when available for maximum accuracy. +# if __has_include() +# include +# elif __has_include("pcre2.h") +# include "pcre2.h" +# else +# error "Missing required pcre2.h header" +# endif +#else +# include "pcre2.h" +#endif typedef struct { PyObject_HEAD