include/stdlib.h: define system()'s prototype for the flat build

The `$(APPDIR)` folder is added to the `$(KERNDEPDIRS)` when
`CONFIG_BUILD_KERNEL=y`. The `depend` phase iterates over the
`$(KERNDEPDIRS)` folders and executes the `depend` recipe of these
folders (including the apps' recipes) with the `__KERNEL__` macro
defined, which prevents `system()`'s prototype from being declared.
This commit is contained in:
Tiago Medicci Serrano 2025-01-29 18:13:02 -03:00 committed by archer
parent c319863834
commit 2ebdd72487

View file

@ -183,7 +183,7 @@ void _Exit(int status) noreturn_function;
* standards compatibility.
*/
#ifndef __KERNEL__
#if !defined(__KERNEL__) || defined(CONFIG_BUILD_FLAT)
int system(FAR const char *cmd);
#endif