mirror of
https://github.com/curl/curl.git
synced 2026-07-24 20:27:18 +03:00
build: tidy-up MSVC CRT warning suppression macros
- curl_setup.h: replace `_CRT_SECURE_NO_DEPRECATE` with `_CRT_SECURE_NO_WARNINGS`, which seems to be the preferred, more recent macro for this. Also syncing with libssh2. They are equivalent for curl sources with the supported compilers. - cmake: stop setting `_CRT_SECURE_NO_DEPRECATE` globally for examples. - examples: suppress CRT deprecation warnings on a per-file basis. To make it work when compiling examples out of curl's build systems. Use `_CRT_SECURE_NO_WARNINGS`. - examples: document the functions requiring `_CRT_SECURE_NO_WARNINGS`. - examples/block_ip: delete superfluous `_CRT_SECURE_NO_WARNINGS`. - examples/block_ip: limit `_CRT_NONSTDC_NO_DEPRECATE` to MSVC. - examples/log_failed_transfers: fix to set `_CRT_SECURE_NO_WARNINGS` before headers and limit to MSVC. - curl_setup.h: document which SDKs support `_CRT_NONSTDC_NO_DEPRECATE`. Closes #19175
This commit is contained in:
parent
1e1ec7f6c2
commit
5fa2d8320c
27 changed files with 201 additions and 63 deletions
|
|
@ -34,13 +34,13 @@
|
|||
int main(void) { printf("Platform not supported.\n"); return 1; }
|
||||
#else
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#ifndef _CRT_NONSTDC_NO_DEPRECATE
|
||||
#define _CRT_NONSTDC_NO_DEPRECATE
|
||||
#define _CRT_NONSTDC_NO_DEPRECATE /* for strdup() */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0600 /* Requires Windows Vista */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue