xref: /PHP-7.3/ext/pcre/pcre2lib/config.h (revision a5bc5aed)
1 
2 #include <php_compat.h>
3 
4 #ifdef PHP_WIN32
5 # include <config.w32.h>
6 #else
7 # include <php_config.h>
8 #endif
9 
10 #undef PACKAGE_NAME
11 #undef PACKAGE_VERSION
12 #undef PACKAGE_TARNAME
13 #undef PACKAGE_STRING
14 
15 #define SUPPORT_UNICODE 1
16 #define SUPPORT_PCRE2_8 1
17 
18 #if defined(__GNUC__) && __GNUC__ >= 4
19 # ifdef __cplusplus
20 #  define PCRE2_EXP_DECL		extern "C" __attribute__ ((visibility("default")))
21 # else
22 #  define PCRE2_EXP_DECL		extern __attribute__ ((visibility("default")))
23 # endif
24 # define PCRE2_EXP_DEFN		__attribute__ ((visibility("default")))
25 #endif
26 
27 /* Define to any value for valgrind support to find invalid memory reads. */
28 #if HAVE_PCRE_VALGRIND_SUPPORT
29 #define SUPPORT_VALGRIND 1
30 #endif
31 
32 /* Define to any value to enable support for Just-In-Time compiling. */
33 #if HAVE_PCRE_JIT_SUPPORT
34 #define SUPPORT_JIT
35 #endif
36 
37 /* This limits the amount of memory that pcre2_match() may use while matching
38    a pattern. The value is in kilobytes. */
39 #ifndef HEAP_LIMIT
40 #define HEAP_LIMIT 20000000
41 #endif
42 
43 /* The value of PARENS_NEST_LIMIT specifies the maximum depth of nested
44    parentheses (of any kind) in a pattern. This limits the amount of system
45    stack that is used while compiling a pattern. */
46 #ifndef PARENS_NEST_LIMIT
47 #define PARENS_NEST_LIMIT 250
48 #endif
49 
50 /* The value of MATCH_LIMIT determines the default number of times the
51    pcre2_match() function can record a backtrack position during a single
52    matching attempt. There is a runtime interface for setting a different
53    limit. The limit exists in order to catch runaway regular expressions that
54    take for ever to determine that they do not match. The default is set very
55    large so that it does not accidentally catch legitimate cases. */
56 #ifndef MATCH_LIMIT
57 #define MATCH_LIMIT 10000000
58 #endif
59 
60 /* The above limit applies to all backtracks, whether or not they are nested.
61    In some environments it is desirable to limit the nesting of backtracking
62    (that is, the depth of tree that is searched) more strictly, in order to
63    restrict the maximum amount of heap memory that is used. The value of
64    MATCH_LIMIT_DEPTH provides this facility. To have any useful effect, it
65    must be less than the value of MATCH_LIMIT. The default is to use the same
66    value as MATCH_LIMIT. There is a runtime method for setting a different
67    limit. */
68 #ifndef MATCH_LIMIT_DEPTH
69 #define MATCH_LIMIT_DEPTH MATCH_LIMIT
70 #endif
71 
72 /* This limit is parameterized just in case anybody ever wants to change it.
73    Care must be taken if it is increased, because it guards against integer
74    overflow caused by enormously large patterns. */
75 #ifndef MAX_NAME_COUNT
76 #define MAX_NAME_COUNT 10000
77 #endif
78 
79 /* This limit is parameterized just in case anybody ever wants to change it.
80    Care must be taken if it is increased, because it guards against integer
81    overflow caused by enormously large patterns. */
82 #ifndef MAX_NAME_SIZE
83 #define MAX_NAME_SIZE 32
84 #endif
85 
86 /* Defining NEVER_BACKSLASH_C locks out the use of \C in all patterns. */
87 /* #undef NEVER_BACKSLASH_C */
88 
89 /* The value of NEWLINE_DEFAULT determines the default newline character
90    sequence. PCRE2 client programs can override this by selecting other values
91    at run time. The valid values are 1 (CR), 2 (LF), 3 (CRLF), 4 (ANY), 5
92    (ANYCRLF), and 6 (NUL). */
93 #ifndef NEWLINE_DEFAULT
94 #define NEWLINE_DEFAULT 2
95 #endif
96 
97 /* The value of LINK_SIZE determines the number of bytes used to store links
98    as offsets within the compiled regex. The default is 2, which allows for
99    compiled patterns up to 64K long. This covers the vast majority of cases.
100    However, PCRE2 can also be compiled to use 3 or 4 bytes instead. This
101    allows for longer patterns in extreme cases. */
102 #ifndef LINK_SIZE
103 #define LINK_SIZE 2
104 #endif
105 
106