mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-08 14:07:23 +00:00
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>
19 lines
673 B
Diff
19 lines
673 B
Diff
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"
|