From 8991da6a3864d93d860afe4c510b4fdbf0da6363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Sun, 25 Aug 2019 11:22:22 -0700 Subject: grep: make sure NO_LIBPCRE1_JIT disable JIT in PCRE1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit e87de7cab4 ("grep: un-break building with PCRE < 8.32", 2017-05-25) added a restriction for JIT support that is no longer needed after pcre_jit_exec() calls were removed. Reorganize the definitions in grep.h so that JIT support could be detected early and NO_LIBPCRE1_JIT could be used reliably to enforce JIT doesn't get used. Signed-off-by: Carlo Marcelo Arenas Belón Signed-off-by: Junio C Hamano --- grep.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'grep.h') diff --git a/grep.h b/grep.h index c0c71eb4a9..1a044c501e 100644 --- a/grep.h +++ b/grep.h @@ -3,14 +3,12 @@ #include "color.h" #ifdef USE_LIBPCRE1 #include -#ifdef PCRE_CONFIG_JIT -#if PCRE_MAJOR >= 8 && PCRE_MINOR >= 32 #ifndef NO_LIBPCRE1_JIT +#ifdef PCRE_CONFIG_JIT #define GIT_PCRE1_USE_JIT #define GIT_PCRE_STUDY_JIT_COMPILE PCRE_STUDY_JIT_COMPILE #endif #endif -#endif #ifndef GIT_PCRE_STUDY_JIT_COMPILE #define GIT_PCRE_STUDY_JIT_COMPILE 0 #endif -- cgit v1.2.3 From ff61681b46760f6a64353018760bccc14c90f8e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Sun, 25 Aug 2019 11:22:23 -0700 Subject: grep: refactor and simplify PCRE1 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code used both a macro and a variable to keep track if JIT support was desired and relied on the fact that a non JIT enabled library will ignore a request for JIT compilation (as defined by the second parameter of the call to pcre_study) Cleanup the multiple levels of macros used and call pcre_study with the right parameter after JIT support has been confirmed and unless it was requested to be disabled with NO_LIBPCRE1_JIT Signed-off-by: Carlo Marcelo Arenas Belón Signed-off-by: Junio C Hamano --- grep.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'grep.h') diff --git a/grep.h b/grep.h index 1a044c501e..ff620d784a 100644 --- a/grep.h +++ b/grep.h @@ -3,15 +3,6 @@ #include "color.h" #ifdef USE_LIBPCRE1 #include -#ifndef NO_LIBPCRE1_JIT -#ifdef PCRE_CONFIG_JIT -#define GIT_PCRE1_USE_JIT -#define GIT_PCRE_STUDY_JIT_COMPILE PCRE_STUDY_JIT_COMPILE -#endif -#endif -#ifndef GIT_PCRE_STUDY_JIT_COMPILE -#define GIT_PCRE_STUDY_JIT_COMPILE 0 -#endif #else typedef int pcre; typedef int pcre_extra; -- cgit v1.2.3