Skip to content

Commit

Permalink
Initial support for NuttX
Browse files Browse the repository at this point in the history
Define the essential types that for NuttX OS.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
  • Loading branch information
no1wudi committed Sep 19, 2024
1 parent a6386af commit c0aab43
Show file tree
Hide file tree
Showing 3 changed files with 574 additions and 3 deletions.
4 changes: 3 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
const CHECK_CFG_EXTRA: &'static [(&'static str, &'static [&'static str])] = &[
(
"target_os",
&["switch", "aix", "ohos", "hurd", "rtems", "visionos"],
&[
"switch", "aix", "ohos", "hurd", "rtems", "visionos", "nuttx",
],
),
("target_env", &["illumos", "wasi", "aix", "ohos"]),
(
Expand Down
10 changes: 8 additions & 2 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,11 @@ extern "C" {
}

cfg_if! {
if #[cfg(any(target_os = "l4re", target_os = "espidf"))] {
// required libraries for L4Re and the ESP-IDF framework are linked externally, ATM
if #[cfg(any(target_os = "l4re", target_os = "espidf", target_os = "nuttx"))] {
// required libraries are linked externally for these platforms:
// * L4Re
// * ESP-IDF
// * NuttX
} else if #[cfg(feature = "std")] {
// cargo build, don't pull in anything extra as the std dep
// already pulls in all libs.
Expand Down Expand Up @@ -1610,6 +1613,9 @@ cfg_if! {
} else if #[cfg(target_os = "hurd")] {
mod hurd;
pub use self::hurd::*;
} else if #[cfg(target_os = "nuttx")] {
mod nuttx;
pub use self::nuttx::*;
} else {
// Unknown target_os
}
Expand Down
Loading

0 comments on commit c0aab43

Please sign in to comment.