From 7b35e23fb3639d1753f4de0a1880a4ac8ac687cb Mon Sep 17 00:00:00 2001 From: Eduardo Arias Date: Mon, 29 Apr 2024 16:39:05 -0300 Subject: [PATCH] strdup not available in MSVC compiler - Added define to avoid the following warning, treated as an error by the nginx build system: warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details. --- src/ngx_http_modsecurity_module.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ngx_http_modsecurity_module.c b/src/ngx_http_modsecurity_module.c index 8c298af..18e7b54 100644 --- a/src/ngx_http_modsecurity_module.c +++ b/src/ngx_http_modsecurity_module.c @@ -25,6 +25,10 @@ #include #include +#ifdef WIN32 +#define strdup _strdup +#endif + static ngx_int_t ngx_http_modsecurity_init(ngx_conf_t *cf); static void *ngx_http_modsecurity_create_main_conf(ngx_conf_t *cf); static char *ngx_http_modsecurity_init_main_conf(ngx_conf_t *cf, void *conf);