From 99341fcd2f845edc6fed3b666cd910158bdc68d1 Mon Sep 17 00:00:00 2001 From: Mark Stevens Date: Tue, 19 May 2026 09:18:33 +0100 Subject: [PATCH] Fix build issues with 15.x toolchain. --- apps/examples/hcom/cell/cmux/hcom_cmux.c | 1 + apps/examples/hcom/diag/hcom_diag_gpio.c | 1 + apps/examples/hcom/mono/hcom_mono_control.c | 1 + apps/examples/hcom/ota/hcom_ota.c | 2 +- apps/examples/sqlite/sqlite_meadow.c | 7 +++++-- apps/examples/sqlite/sqlite_meadow.h | 4 ++++ bootloader/Core/Src/sysmem.c | 2 ++ nuttx/include/nuttx/lib/math.h | 5 +++++ nuttx/libs/libc/stdlib/lib_openpty.c | 6 +++++- 9 files changed, 25 insertions(+), 4 deletions(-) diff --git a/apps/examples/hcom/cell/cmux/hcom_cmux.c b/apps/examples/hcom/cell/cmux/hcom_cmux.c index 2b021f34934..c1ad21c0725 100644 --- a/apps/examples/hcom/cell/cmux/hcom_cmux.c +++ b/apps/examples/hcom/cell/cmux/hcom_cmux.c @@ -54,6 +54,7 @@ #include #include +#include "../../hcom_common.h" #include "hcom_cmux.h" #include "netutils/cmux.h" diff --git a/apps/examples/hcom/diag/hcom_diag_gpio.c b/apps/examples/hcom/diag/hcom_diag_gpio.c index 12b2c40e94e..da2cd38f672 100644 --- a/apps/examples/hcom/diag/hcom_diag_gpio.c +++ b/apps/examples/hcom/diag/hcom_diag_gpio.c @@ -44,6 +44,7 @@ #include "../hcom_common.h" #include +#include #include "hcom_diag_gpio.h" /**************************************************************************** diff --git a/apps/examples/hcom/mono/hcom_mono_control.c b/apps/examples/hcom/mono/hcom_mono_control.c index a65fb29f862..130ef460c54 100644 --- a/apps/examples/hcom/mono/hcom_mono_control.c +++ b/apps/examples/hcom/mono/hcom_mono_control.c @@ -51,6 +51,7 @@ #include #include +#include #include "diag/hcom_diag_gpio.h" diff --git a/apps/examples/hcom/ota/hcom_ota.c b/apps/examples/hcom/ota/hcom_ota.c index 9273159ece4..1a9df8c9337 100644 --- a/apps/examples/hcom/ota/hcom_ota.c +++ b/apps/examples/hcom/ota/hcom_ota.c @@ -485,7 +485,7 @@ int meadow_cloud_decrypt_buf(const unsigned char *encrypted_buf, int encrypted_l return -1; } - meadow_cloud_release_private_key((const char**) &private_key); + meadow_cloud_release_private_key((char** const) &private_key); unsigned char result[MBEDTLS_MPI_MAX_SIZE]; size_t olen = 0; diff --git a/apps/examples/sqlite/sqlite_meadow.c b/apps/examples/sqlite/sqlite_meadow.c index 24828b02e50..2b873c0bc75 100644 --- a/apps/examples/sqlite/sqlite_meadow.c +++ b/apps/examples/sqlite/sqlite_meadow.c @@ -1,9 +1,12 @@ #include "sqlite3.h" + +#include "sqlite_meadow.h" + #include "syslog.h" // These are called by initialization, but are not defined unless SQLITE_OS_UNIX is defined // If you define SQLITE_OS_UNIX, it fails because Nuttx doesn't implement things like fchmod -SQLITE_API sqlite3_os_init(void) +SQLITE_API int sqlite3_os_init(void) { // we must register the `demovfs` that Meadow uses sqlite3_vfs *pVfs = sqlite3_demovfs(); @@ -22,7 +25,7 @@ SQLITE_API sqlite3_os_init(void) return SQLITE_OK; } -SQLITE_API sqlite3_os_end(void) +SQLITE_API int sqlite3_os_end(void) { return SQLITE_OK; } \ No newline at end of file diff --git a/apps/examples/sqlite/sqlite_meadow.h b/apps/examples/sqlite/sqlite_meadow.h index 14244ce1998..75a9a4da732 100644 --- a/apps/examples/sqlite/sqlite_meadow.h +++ b/apps/examples/sqlite/sqlite_meadow.h @@ -36,10 +36,14 @@ #ifndef ___SQLITE_MEADOW__H #define ___SQLITE_MEADOW__H +#include "sqlite3.h" + /**************************************************************************** * Included Files ****************************************************************************/ #define VIRTUAL_FILE_SYS_NAME "meadow" +sqlite3_vfs *sqlite3_demovfs(void); + #endif // ___SQLITE_MEADOW__H \ No newline at end of file diff --git a/bootloader/Core/Src/sysmem.c b/bootloader/Core/Src/sysmem.c index 4665417ed57..56a9099f33b 100644 --- a/bootloader/Core/Src/sysmem.c +++ b/bootloader/Core/Src/sysmem.c @@ -29,6 +29,8 @@ extern int errno; register char * stack_ptr asm("sp"); +typedef char * caddr_t; + /* Functions */ /** diff --git a/nuttx/include/nuttx/lib/math.h b/nuttx/include/nuttx/lib/math.h index eff0f02e640..df5ba5fbfcd 100644 --- a/nuttx/include/nuttx/lib/math.h +++ b/nuttx/include/nuttx/lib/math.h @@ -286,6 +286,11 @@ double log2 (double x); long double log2l (long double x); #endif +#ifdef CONFIG_HAVE_DOUBLE +extern double hypot (double, double); +#endif + + float ilogbf (float x); #ifdef CONFIG_HAVE_DOUBLE double ilogb (double x); diff --git a/nuttx/libs/libc/stdlib/lib_openpty.c b/nuttx/libs/libc/stdlib/lib_openpty.c index 24f74dc5740..53e212ab71e 100644 --- a/nuttx/libs/libc/stdlib/lib_openpty.c +++ b/nuttx/libs/libc/stdlib/lib_openpty.c @@ -34,6 +34,10 @@ #include +FAR char *ptsname(int fd); +int ptsname_r(int fd, FAR char *buf, size_t buflen); + + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -177,7 +181,7 @@ int openpty(FAR int *master, FAR int *slave, FAR char *name, if (win != NULL) { - ioctl(*slave, TIOCSWINSZ, win); + ioctl(*slave, TIOCSWINSZ, (unsigned long) win); } return 0;