config.h 3.6 KB

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