build: fix -Wunused-macros warnings, and related tidy-ups

- fix internal macro `AN_APPLE_OS` reused between sources without
  resetting it. It may potentially have left the system sha256
  function unused.
- fix to define `WOLFSSL_OPTIONS_IGNORE_SYS` so that it always applies
  to wolfSSL headers, also during feature detection.
- md4, md5, sha256: simplify fallback logic.
- delete 20+ unused macros.
- scope or move macros to avoid `-Wunused-macros` warnings.
- examples: delete unused code.

The warning detects macros defined but not used within the same C
source. It does not warn for macros defined in headers. It also works
with unity builds, but to a lesser extent.

Closes #20593
This commit is contained in:
Viktor Szakats 2026-02-13 17:05:36 +01:00
parent 633ec719d5
commit 5fa5cb3825
No known key found for this signature in database
28 changed files with 105 additions and 161 deletions

View file

@ -50,6 +50,7 @@
/* Largest supported ASN.1 structure. */
#define CURL_ASN1_MAX ((size_t)0x40000) /* 256K */
#ifdef WANT_EXTRACT_CERTINFO
/* ASN.1 classes. */
/* #define CURL_ASN1_UNIVERSAL 0 */
/* #define CURL_ASN1_APPLICATION 1 */
@ -86,7 +87,6 @@
/* #define CURL_ASN1_CHARACTER_STRING 29 */
#define CURL_ASN1_BMP_STRING 30
#ifdef WANT_EXTRACT_CERTINFO
/* ASN.1 OID table entry. */
struct Curl_OID {
const char *numoid; /* Dotted-numeric OID. */