windows: fix builds targeting WinXP, test it in CI

- appveyor: make a job target Windows XP.

- examples/block_ip: force this specific example to target Vista to make
  it compile when building curl for Windows XP. Fixing:
  ```
  docs\examples\block_ip.c(157): warning C4013: 'inet_pton' undefined; assuming extern returning int
  docs\examples\block_ip.c(272): warning C4013: 'inet_ntop' undefined; assuming extern returning int
  ```
  Ref: https://ci.appveyor.com/project/curlorg/curl/builds/52102142/job/2ajdluhc20r4gmmw#L530

Cherry-picked from #17413
Closes #17415
This commit is contained in:
Viktor Szakats 2025-05-22 12:16:11 +02:00
parent 203b4349af
commit 4331e7087b
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
3 changed files with 5 additions and 2 deletions

View file

@ -41,8 +41,9 @@ int main(void) { printf("Platform not supported.\n"); return 1; }
#ifndef _CRT_NONSTDC_NO_DEPRECATE
#define _CRT_NONSTDC_NO_DEPRECATE
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0600 /* Requires Windows Vista */
#endif
#include <winsock2.h>
#include <ws2tcpip.h>