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 <arjav1528@gmail.com>
This commit is contained in:
Arjav Patel 2026-05-23 15:40:17 +00:00 committed by Lup Yuen Lee
parent 55a7d4d2df
commit 939ed0ca2a

View file

@ -0,0 +1,19 @@
From: micro-ROS NuttX Port <noreply@nuttx.apache.org>
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"