From: Viktor Szakats Date: Sat, 4 Oct 2025 02:33:49 +0000 (+0200) Subject: examples: fix two build issues surfaced with WinCE X-Git-Tag: rc-8_17_0-3~349 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4535532ed36d2129b107ab357262072f82c2b34a;p=thirdparty%2Fcurl.git examples: fix two build issues surfaced with WinCE Both may apply to rare non-WinCE Windows builds too. - fix gcc 4.4.0 preprocessor error: ``` docs/examples/http2-upload.c:43:8: error: "_MSC_VER" is not defined ``` Ref: https://github.com/curl/curl/actions/runs/18238150607/job/51935502616 - fix wrong header order: Inlcude `windows.h` after `winsock2.h` via `curl/curl.h`. Regressions from 45438c8d6f8e70385d66c029568524e9e803c539 #18823 Closes #18843 --- diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index 9508da694b..a22161d76d 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -40,8 +40,6 @@ #ifndef _MSC_VER #include #include -#elif (_MSC_VER < 1900) -#define snprintf _snprintf #endif #ifdef _WIN32 @@ -52,6 +50,10 @@ #define fileno _fileno #endif +#if defined(_MSC_VER) && (_MSC_VER < 1900) +#define snprintf _snprintf +#endif + /* curl stuff */ #include diff --git a/docs/examples/synctime.c b/docs/examples/synctime.c index dd21082446..d8264d012e 100644 --- a/docs/examples/synctime.c +++ b/docs/examples/synctime.c @@ -90,11 +90,12 @@ int main(void) { printf("Platform not supported.\n"); return 1; } int main(void) { printf("Platform not supported.\n"); return 1; } #else -#include #include #include +#include + #if defined(_MSC_VER) && (_MSC_VER < 1900) #define snprintf _snprintf #endif