This is an automated email from the ASF dual-hosted git repository.

lupyuen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 939ed0ca2a7b593949973be5d09aefea1b659418
Author: Arjav Patel <[email protected]>
AuthorDate: Sat May 23 15:40:17 2026 +0000

    apps/system/microros: add rcutils strcasecmp strings.h include patch.
    
    POSIX specifies strcasecmp/strncasecmp in <strings.h>, not <string.h>.
    On NuttX (and other strict POSIX environments) rcutils/src/strcasecmp.c
    only includes <string.h>, causing an implicit-declaration error for
    strcasecmp when cross-compiling.
    
    Patch 0003 adds #include <strings.h> guarded by !_WIN32, matching the
    existing Windows/POSIX split in the file.
    
    Signed-off-by: Arjav Patel <[email protected]>
---
 .../0003-rcutils-strcasecmp-include-strings-h.patch   | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git 
a/system/microros/patches/0003-rcutils-strcasecmp-include-strings-h.patch 
b/system/microros/patches/0003-rcutils-strcasecmp-include-strings-h.patch
new file mode 100644
index 000000000..7392f2828
--- /dev/null
+++ b/system/microros/patches/0003-rcutils-strcasecmp-include-strings-h.patch
@@ -0,0 +1,19 @@
+From: micro-ROS NuttX Port <[email protected]>
+Subject: [PATCH] rcutils: include <strings.h> for strcasecmp on NuttX
+
+POSIX specifies strcasecmp/strncasecmp in <strings.h>, not <string.h>.
+NuttX follows the standard strictly so omitting this header causes an
+"implicit declaration" error.  Guard the include with __NuttX__ so it
+only applies where needed and does not affect Linux or other platforms
+that already expose strcasecmp through <string.h>.
+
+--- a/rcutils/src/strcasecmp.c
++++ b/rcutils/src/strcasecmp.c
+@@ -17,6 +17,9 @@ extern "C"
+ #include <errno.h>
+ #include <string.h>
++#ifdef __NuttX__
++#include <strings.h>
++#endif
+
+ #include "rcutils/strcasecmp.h"

Reply via email to