Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 8 commits into from

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Dec 20, 2024

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

```
../../../docs/examples/anyauthput.c:37: error: "stat" redefined
   37 | #define stat _stat
      |
In file included from ../../../docs/examples/anyauthput.c:32:
/usr/share/mingw-w64/include/sys/stat.h:279: note: this is the location of the previous definition
  279 | #define stat _stat64
      |
../../../docs/examples/anyauthput.c:38: error: "fstat" redefined
   38 | #define fstat _fstat
      |
In file included from ../../../docs/examples/anyauthput.c:32:
/usr/share/mingw-w64/include/sys/stat.h:280: note: this is the location of the previous definition
  280 | #define fstat _fstat64
      |
```
https://github.com/curl/curl/actions/runs/12075608343/job/33675692693#step:10:23
@vszakats vszakats changed the title examples: make them compiler with compatibility functions disabled (Windows) examples: make them compile with compatibility functions disabled (Windows) Dec 20, 2024
@vszakats vszakats closed this in 46093d9 Dec 20, 2024
@vszakats vszakats deleted the examples-oldnames branch December 20, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants