From 5ca249631d6f10128915ab54e6d8cc7bc7ebbaaf Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 7 Jul 2025 13:18:21 +0900 Subject: [PATCH] system/dd: portability to non-nuttx platforms while this is not a goal for this repository, it's convenient for me (hopefully for some others too) to be able to build this for other platforms. an obvious downside is to have a few more ifdefs. tested with: ``` /opt/wasi-sdk-25.0/bin/clang -Wall -Oz -s -o dd.wasm dd_main.c ``` Signed-off-by: YAMAMOTO Takashi --- system/dd/dd_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index 4ab595b078b..a67698608d0 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -31,7 +31,9 @@ #include #include +#if defined(__NuttX__) #include +#endif #include #include #include @@ -246,11 +248,15 @@ static int dd_verify(FAR struct dd_s *dd) if (memcmp(dd->buffer, buffer, dd->nbytes) != 0) { +#if defined(__NuttX__) char msg[32]; snprintf(msg, sizeof(msg), "infile sector %d", sector); lib_dumpbuffer(msg, dd->buffer, dd->nbytes); snprintf(msg, sizeof(msg), "\noutfile sector %d", sector); lib_dumpbuffer(msg, buffer, dd->nbytes); +#else + printf("%s: sector %d differs unexpectedly\n", g_dd, sector); +#endif ret = ERROR; break; }