examples: make them compile with compatibility functions disabled (Windows)

For MinGW this is `-DNO_OLDNAMES`, with MSVC it is
`-D_CRT_DECLARE_NONSTDC_NAMES=0`.

There have been some support for this before this patch.
After this patch this is extended to all examples.

(And also the standalone http/client programs, if here.)

Cherry-picked from #15652
Closes #15789
This commit is contained in:
Viktor Szakats 2024-11-28 14:59:35 +01:00
parent 37fb50a858
commit 46093d9e0e
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
6 changed files with 30 additions and 4 deletions

View file

@ -37,6 +37,10 @@
#include <unistd.h> /* getopt() */
#endif
#ifdef _WIN32
#define strdup _strdup
#endif
#ifndef CURLPIPE_MULTIPLEX
#error "too old libcurl, cannot do HTTP/2 server push!"
#endif