[PATCH] Win32: PCRE2 Unicode support with MSVC

Sergey Kandaurov pluknet at nginx.com
Mon Mar 20 14:58:32 UTC 2023


# HG changeset patch
# User Sergey Kandaurov <pluknet at nginx.com>
# Date 1679324252 -14400
#      Mon Mar 20 18:57:32 2023 +0400
# Node ID d0b013a7050e00613804b399ae2ca74551b2a071
# Parent  8771d35d55d0a2b1cefaab04401d6f837f5a05a2
Win32: PCRE2 Unicode support with MSVC.

Unicode support in PCRE2 is enabled by default on configure/cmake side
by defining SUPPORT_UNICODE.  Previously, this macro was not defined
when compiling directly PCRE2 sources for Windows with MSVC.

In particular, this change allows to specify Unicode properties, such as
\P, \p, or \X, as caught by http_server_name.t adjusted to run on Windows:

nginx: [emerg] pcre2_compile() failed: this version of PCRE2 does not have
support for \P, \p, or \X

diff --git a/auto/lib/pcre/make b/auto/lib/pcre/make
--- a/auto/lib/pcre/make
+++ b/auto/lib/pcre/make
@@ -61,7 +61,7 @@ if [ $PCRE_LIBRARY = PCRE2 ]; then
 
 PCRE_CFLAGS =	-O2 -Ob1 -Oi -Gs $LIBC $CPU_OPT
 PCRE_FLAGS =	-DHAVE_CONFIG_H -DPCRE2_STATIC -DPCRE2_CODE_UNIT_WIDTH=8 \\
-		-DHAVE_MEMMOVE
+		-DHAVE_MEMMOVE -DSUPPORT_UNICODE
 
 PCRE_SRCS =	 $ngx_pcre_srcs
 PCRE_OBJS =	 $ngx_pcre_objs


More information about the nginx-devel mailing list