From c436194d43131afdca4cb3d9d4af1825688a02d0 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Mon, 17 Jun 2024 11:41:37 +0100 Subject: [PATCH] Fix #2789 - rename local var to avoid clash with system include --- mongoose.c | 6 +++--- src/tls_chacha20.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mongoose.c b/mongoose.c index a0451301..ba658490 100644 --- a/mongoose.c +++ b/mongoose.c @@ -10935,10 +10935,10 @@ static void core_block(const uint32_t *restrict start, uint32_t *restrict output) { // instead of working on the output array, // we let the compiler allocate 16 local variables on the stack -#define __LV(i) uint32_t __s##i = start[i]; +#define __LV(i) uint32_t __t##i = start[i]; TIMES16(__LV) -#define __Q(a, b, c, d) Qround(__s##a, __s##b, __s##c, __s##d) +#define __Q(a, b, c, d) Qround(__t##a, __t##b, __t##c, __t##d) for (int i = 0; i < 10; i++) { __Q(0, 4, 8, 12); @@ -10951,7 +10951,7 @@ static void core_block(const uint32_t *restrict start, __Q(3, 4, 9, 14); } -#define __FIN(i) output[i] = start[i] + __s##i; +#define __FIN(i) output[i] = start[i] + __t##i; TIMES16(__FIN) } diff --git a/src/tls_chacha20.c b/src/tls_chacha20.c index 1def3aae..111ebae2 100644 --- a/src/tls_chacha20.c +++ b/src/tls_chacha20.c @@ -154,10 +154,10 @@ static void core_block(const uint32_t *restrict start, uint32_t *restrict output) { // instead of working on the output array, // we let the compiler allocate 16 local variables on the stack -#define __LV(i) uint32_t __s##i = start[i]; +#define __LV(i) uint32_t __t##i = start[i]; TIMES16(__LV) -#define __Q(a, b, c, d) Qround(__s##a, __s##b, __s##c, __s##d) +#define __Q(a, b, c, d) Qround(__t##a, __t##b, __t##c, __t##d) for (int i = 0; i < 10; i++) { __Q(0, 4, 8, 12); @@ -170,7 +170,7 @@ static void core_block(const uint32_t *restrict start, __Q(3, 4, 9, 14); } -#define __FIN(i) output[i] = start[i] + __s##i; +#define __FIN(i) output[i] = start[i] + __t##i; TIMES16(__FIN) }