lwthiker / curl-impersonate

curl-impersonate: A special build of curl that can impersonate Chrome & Firefox
MIT License
3.45k stars 229 forks source link

Error on windows VS 2022 build #188

Open ypsik opened 9 months ago

ypsik commented 9 months ago

Hello,

thanks great work, im building new version on windows and have error 1>D:\curl-8.1.1\lib\vtls\openssl.c(331,48): error E0028 expression must have a constant value looks like its this line char algname[kMaxSignatureAlgorithmNameLen + 1]; VS not supporting variable length array

gvanem commented 8 months ago

I hit this issue too. So I ended up generating all the .patch files using this GNU-makefile to build curl-impersonate-chrome.exe to work with the current curl (from git master).

Basically I changed the patch to this:

  +
  +/*
  + * kMaxSignatureAlgorithmNameLen and kSignatureAlgorithmNames
  + * Taken from BoringSSL, see ssl/ssl_privkey.cc
  + * */
  +#define kMaxSignatureAlgorithmNameLen 23
  +

I fail to see what is so good about a const size_t variable when a #define suits just fine.