Fix for IDN2 call on Windows.

This commit is contained in:
LoRd_MuldeR 2021-06-10 02:15:19 +02:00
parent d06cf480fe
commit de2326cc4e
2 changed files with 19 additions and 0 deletions

View File

@ -183,6 +183,7 @@ pushd "${CURL_DIR}"
patch -p1 -b < "${BASE_DIR}/patch/curl_threads.diff"
patch -p1 -b < "${BASE_DIR}/patch/curl_tool_doswin.diff"
patch -p1 -b < "${BASE_DIR}/patch/curl_tool_parsecfg.diff"
patch -p1 -b < "${BASE_DIR}/patch/curl_url.diff"
sed -i -E 's/\bmain[[:space:]]*\(([^\(\)]*)\)/wmain(\1)/g' configure
CFLAGS="-municode -mconsole -march=${MY_MARCH} -mtune=${MY_MTUNE} -I\"${LIBS_DIR}/include\"" CPPFLAGS="-DNGHTTP2_STATICLIB" LDFLAGS="-static -no-pthread -L\"${LIBS_DIR}/lib\"" LIBS="-latomic -liconv -lcrypt32" PKG_CONFIG_PATH="${LIBS_DIR}/pkgconfig" ./configure --enable-static --disable-shared --disable-pthreads --disable-libcurl-option --disable-openssl-auto-load-config --with-zlib="${LIBS_DIR}" --with-zstd="${LIBS_DIR}" --with-brotli="${LIBS_DIR}" --with-openssl="${LIBS_DIR}" --with-libssh2="${LIBS_DIR}" --with-nghttp2="${LIBS_DIR}" --with-libidn2="${LIBS_DIR}" --with-gsasl="${LIBS_DIR}" --without-ca-bundle
make curl_LDFLAGS=-all-static

18
patch/curl_url.diff Normal file
View File

@ -0,0 +1,18 @@
diff --git "a/D:\\_Sandbox\\curl\\curl-src\\lib\\url.c.orig" "b/D:\\_Sandbox\\curl\\curl-src\\lib\\url.c"
index 1ee38af..0a6ba91 100644
--- "a/lib/url.c"
+++ "b/lib/url.c"
@@ -1577,11 +1577,11 @@ CURLcode Curl_idnconvert_hostname(struct Curl_easy *data,
#else
int flags = IDN2_NFC_INPUT;
#endif
- int rc = idn2_lookup_ul((const char *)host->name, &ace_hostname, flags);
+ int rc = idn2_lookup_u8((const uint8_t *)host->name, (uint8_t **)&ace_hostname, flags);
if(rc != IDN2_OK)
/* fallback to TR46 Transitional mode for better IDNA2003
compatibility */
- rc = idn2_lookup_ul((const char *)host->name, &ace_hostname,
+ rc = idn2_lookup_u8((const uint8_t *)host->name, (uint8_t **)&ace_hostname,
IDN2_TRANSITIONAL);
if(rc == IDN2_OK) {
host->encalloc = (char *)ace_hostname;