This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 59855a1a6 remove <nuttx/xxx.h> in stdio need add depend header file
59855a1a6 is described below
commit 59855a1a67d59683e9f64859b8695ca38e881c28
Author: anjiahao <[email protected]>
AuthorDate: Wed Nov 13 09:38:43 2024 +0800
remove <nuttx/xxx.h> in stdio need add depend header file
libuv:
CC: pthread/pthread_mutexattr_setrobust.c libuv/src/unix/thread.c: In
function ‘uv_thread_create_ex’:
libuv/src/unix/thread.c:174:24: error: storage size of ‘param’ isn’t known
174 | struct sched_param param;
| ^~~~~
btsak_main:
In file included from btsak_main.c:39:
btsak.h:149:1: error: unknown type name ‘bool’
149 | bool btsak_str2bool(FAR const char *str);
pipe_main.c:
CC: sim/sim_registerdump.c pipe_main.c:44:30: error: unknown type name
‘pthread_addr_t’
44 | static void *open_write_only(pthread_addr_t pvarg)
| ^~~~~~~~~~~~~~
pipe_main.c: In function ‘pipe_main’:
pipe_main.c:81:3: error: unknown type name ‘pthread_t’
81 | pthread_t writeonly;
redirect_test.c: In function ‘redirection_test’:
redirect_test.c:205:3: error: unknown type name ‘pthread_t’
205 | pthread_t readerid;
| ^~~~~~~~~
redirect_test.c:206:3: error: unknown type name ‘pthread_t’
206 | pthread_t writerid;
| ^~~~~~~~~
drivertest_posix_timer.c:48:29: error: ‘optarg’ undeclared (first use in
this function)
48 | value = (type)strtoul(optarg, &ptr, base);
\
drivertest_posix_timer.c:208:3: warning: implicit declaration of function
‘sleep’ [-Wimplicit-function-declaration]
208 | sleep(SLEEPSECONDS);
| ^~~~~
drivertest_uart.c:92:13: warning: implicit declaration of function ‘read’;
did you mean ‘fread’? [-Wimplicit-function-declaration]
92 | len = read(fd, &tmp_char, 1);
| ^~~~
| fread
drivertest_uart.c:323:44: error: ‘optopt’ undeclared (first use in this
function)
323 | printf("Unknown option: %c\n", optopt);
kernel/fs/cases/fs_getfilep_test.c:71:9: warning: implicit declaration of
function ‘fs_getfilep’ [-Wimplicit-function-declaration]
71 | ret = fs_getfilep(fileno(fp), &filep);
| ^~~~~~~~~~~
kernel/mm/cases/mm_test_008.c:148:9: warning: implicit declaration of
function ‘task_create’; did you mean ‘timer_create’?
[-Wimplicit-function-declaration]
148 | pid = task_create("TestNuttx08_routine_1",
| ^~~~~~~~~~~
| timer_create
/home/ajh/work/nuttxwork/apps/testing/cmocka/cmocka_main.c:171:11: warning:
implicit declaration of function ‘setenv’ [-Wimplicit-function-declaration]
171 | setenv("CMOCKA_XML_FILE", xml_path, 1);
| ^~~~~~
drivertest_pm_runtime.c:123:7: warning: implicit declaration of function
‘usleep’ [-Wimplicit-function-declaration]
123 | usleep(210 * 1000);
| ^~~~~~
Signed-off-by: anjiahao <[email protected]>
---
examples/pipe/pipe_main.c | 1 +
examples/pipe/redirect_test.c | 1 +
system/libuv/0001-libuv-port-for-nuttx.patch | 12 ++++++++++++
system/popen/popen.c | 1 +
testing/cmocka/cmocka_main.c | 1 +
testing/drivertest/drivertest_pm_runtime.c | 1 +
testing/drivertest/drivertest_posix_timer.c | 2 ++
testing/drivertest/drivertest_rtc.c | 1 +
testing/drivertest/drivertest_uart.c | 1 +
testing/testsuites/kernel/fs/cases/fs_getfilep_test.c | 3 +++
testing/testsuites/kernel/mm/cases/mm_test_008.c | 3 +++
wireless/bluetooth/btsak/btsak.h | 1 +
12 files changed, 28 insertions(+)
diff --git a/examples/pipe/pipe_main.c b/examples/pipe/pipe_main.c
index a8e85c696..d34845ce7 100644
--- a/examples/pipe/pipe_main.c
+++ b/examples/pipe/pipe_main.c
@@ -30,6 +30,7 @@
#include <sched.h>
#include <fcntl.h>
#include <errno.h>
+#include <pthread.h>
#include "pipe.h"
diff --git a/examples/pipe/redirect_test.c b/examples/pipe/redirect_test.c
index de45f2d05..9f9a07dca 100644
--- a/examples/pipe/redirect_test.c
+++ b/examples/pipe/redirect_test.c
@@ -30,6 +30,7 @@
#include <unistd.h>
#include <sched.h>
#include <errno.h>
+#include <pthread.h>
#include "pipe.h"
diff --git a/system/libuv/0001-libuv-port-for-nuttx.patch
b/system/libuv/0001-libuv-port-for-nuttx.patch
index 237ff58b6..0c2eb18dd 100644
--- a/system/libuv/0001-libuv-port-for-nuttx.patch
+++ b/system/libuv/0001-libuv-port-for-nuttx.patch
@@ -3960,3 +3960,15 @@ index 57afeb2c..ec8eeb08 100644
+ return UV_ENOTSUP;
+}
+#endif
+diff --color -ur libuv_back/src/unix/thread.c libuv/src/unix/thread.c
+--- libuv_back/src/unix/thread.c 2024-11-13 09:37:22.507687159 +0800
++++ libuv/src/unix/thread.c 2024-11-13 09:37:47.822236556 +0800
+@@ -41,7 +41,7 @@
+ #include <gnu/libc-version.h> /* gnu_get_libc_version() */
+ #endif
+
+-#if defined(__linux__)
++#if defined(__linux__) || defined (__NuttX__)
+ # include <sched.h>
+ # define uv__cpu_set_t cpu_set_t
+ #elif defined(__FreeBSD__)
diff --git a/system/popen/popen.c b/system/popen/popen.c
index a873f3864..d4dd63cf1 100644
--- a/system/popen/popen.c
+++ b/system/popen/popen.c
@@ -35,6 +35,7 @@
#include <assert.h>
#include <debug.h>
#include <fcntl.h>
+#include <errno.h>
#include "nshlib/nshlib.h"
diff --git a/testing/cmocka/cmocka_main.c b/testing/cmocka/cmocka_main.c
index 299550954..00b018994 100644
--- a/testing/cmocka/cmocka_main.c
+++ b/testing/cmocka/cmocka_main.c
@@ -31,6 +31,7 @@
#include <setjmp.h>
#include <stdint.h>
#include <stdio.h>
+#include <stdlib.h>
#include <syslog.h>
#include <sys/wait.h>
#include <builtin/builtin.h>
diff --git a/testing/drivertest/drivertest_pm_runtime.c
b/testing/drivertest/drivertest_pm_runtime.c
index 9e80a0f42..3b8aa9a90 100644
--- a/testing/drivertest/drivertest_pm_runtime.c
+++ b/testing/drivertest/drivertest_pm_runtime.c
@@ -32,6 +32,7 @@
#include <stddef.h>
#include <setjmp.h>
#include <string.h>
+#include <unistd.h>
#include <cmocka.h>
#include <nuttx/power/pm_runtime.h>
diff --git a/testing/drivertest/drivertest_posix_timer.c
b/testing/drivertest/drivertest_posix_timer.c
index 5fc2092f8..fed2f0ce1 100644
--- a/testing/drivertest/drivertest_posix_timer.c
+++ b/testing/drivertest/drivertest_posix_timer.c
@@ -31,6 +31,8 @@
#include <stdint.h>
#include <cmocka.h>
#include <syslog.h>
+#include <getopt.h>
+#include <time.h>
#include <nuttx/timers/timer.h>
/****************************************************************************
diff --git a/testing/drivertest/drivertest_rtc.c
b/testing/drivertest/drivertest_rtc.c
index 0dbf9cebb..01ce8ee70 100644
--- a/testing/drivertest/drivertest_rtc.c
+++ b/testing/drivertest/drivertest_rtc.c
@@ -39,6 +39,7 @@
#include <stdint.h>
#include <cmocka.h>
#include <syslog.h>
+#include <getopt.h>
#include <nuttx/timers/rtc.h>
#include <nuttx/clock.h>
diff --git a/testing/drivertest/drivertest_uart.c
b/testing/drivertest/drivertest_uart.c
index 91b6a0d97..d26d07005 100644
--- a/testing/drivertest/drivertest_uart.c
+++ b/testing/drivertest/drivertest_uart.c
@@ -31,6 +31,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <sys/ioctl.h>
#include <cmocka.h>
diff --git a/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c
b/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c
index 97037fbc8..f894c1716 100644
--- a/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c
+++ b/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c
@@ -27,6 +27,9 @@
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
+
+#include <nuttx/fs/fs.h>
+
#include "fstest.h"
/****************************************************************************
diff --git a/testing/testsuites/kernel/mm/cases/mm_test_008.c
b/testing/testsuites/kernel/mm/cases/mm_test_008.c
index f49148b78..892de5bff 100644
--- a/testing/testsuites/kernel/mm/cases/mm_test_008.c
+++ b/testing/testsuites/kernel/mm/cases/mm_test_008.c
@@ -39,6 +39,9 @@
#include <setjmp.h>
#include <cmocka.h>
#include <malloc.h>
+
+#include <nuttx/sched.h>
+
#include "MmTest.h"
/****************************************************************************
diff --git a/wireless/bluetooth/btsak/btsak.h b/wireless/bluetooth/btsak/btsak.h
index 0affe0f8b..a07b4cd2b 100644
--- a/wireless/bluetooth/btsak/btsak.h
+++ b/wireless/bluetooth/btsak/btsak.h
@@ -32,6 +32,7 @@
#include <nuttx/config.h>
+#include <stdbool.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netpacket/bluetooth.h>