mirror of
https://github.com/nginx/nginx.git
synced 2025-06-16 00:21:02 +08:00
Fixed the ngx_regex.h header file compatibility with C++.
This commit is contained in:
parent
1b4397443f
commit
1c168c7875
@ -152,7 +152,7 @@ ngx_regex_compile(ngx_regex_compile_t *rc)
|
|||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc->regex->pcre = re;
|
rc->regex->code = re;
|
||||||
|
|
||||||
/* do not study at runtime */
|
/* do not study at runtime */
|
||||||
|
|
||||||
@ -367,7 +367,7 @@ ngx_regex_module_init(ngx_cycle_t *cycle)
|
|||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
elts[i].regex->extra = pcre_study(elts[i].regex->pcre, opt, &errstr);
|
elts[i].regex->extra = pcre_study(elts[i].regex->code, opt, &errstr);
|
||||||
|
|
||||||
if (errstr != NULL) {
|
if (errstr != NULL) {
|
||||||
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
|
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
|
||||||
@ -380,7 +380,7 @@ ngx_regex_module_init(ngx_cycle_t *cycle)
|
|||||||
int jit, n;
|
int jit, n;
|
||||||
|
|
||||||
jit = 0;
|
jit = 0;
|
||||||
n = pcre_fullinfo(elts[i].regex->pcre, elts[i].regex->extra,
|
n = pcre_fullinfo(elts[i].regex->code, elts[i].regex->extra,
|
||||||
PCRE_INFO_JIT, &jit);
|
PCRE_INFO_JIT, &jit);
|
||||||
|
|
||||||
if (n != 0 || jit != 1) {
|
if (n != 0 || jit != 1) {
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
pcre *pcre;
|
pcre *code;
|
||||||
pcre_extra *extra;
|
pcre_extra *extra;
|
||||||
} ngx_regex_t;
|
} ngx_regex_t;
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ void ngx_regex_init(void);
|
|||||||
ngx_int_t ngx_regex_compile(ngx_regex_compile_t *rc);
|
ngx_int_t ngx_regex_compile(ngx_regex_compile_t *rc);
|
||||||
|
|
||||||
#define ngx_regex_exec(re, s, captures, size) \
|
#define ngx_regex_exec(re, s, captures, size) \
|
||||||
pcre_exec(re->pcre, re->extra, (const char *) (s)->data, (s)->len, 0, 0, \
|
pcre_exec(re->code, re->extra, (const char *) (s)->data, (s)->len, 0, 0, \
|
||||||
captures, size)
|
captures, size)
|
||||||
#define ngx_regex_exec_n "pcre_exec()"
|
#define ngx_regex_exec_n "pcre_exec()"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user