Commit 57a1c65
committed
fix(libsodium): disable C11 Annex K declarations to fix build with picolibc
Upstream libsodium's utils.c defines __STDC_WANT_LIB_EXT1__=1, which
requests C11 Annex K bounds-checking types (errno_t, rsize_t) from the
C library. With ESP-IDF v6.0+ (which uses picolibc instead of newlib),
this can cause build failures when sys/_types.h is transitively included
by other component headers before utils.c sets the macro. The include
guard in sys/_types.h prevents re-inclusion, so the conditional Annex K
type definitions (__errno_t, __rsize_t) are never reached.
Set __STDC_WANT_LIB_EXT1__=0 as a compile definition so the flag is
applied before any header is processed, avoiding the issue regardless
of include order. This is safe because libsodium does not use any
Annex K functions on ESP-IDF.1 parent 0d74ee3 commit 57a1c65
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
0 commit comments