mirror of
https://github.com/espressif/openthread.git
synced 2026-08-10 12:47:47 +00:00
spinel: Fix for building on platforms without fprintf() (#188)
Some platforms do not implement `fprintf()`. This change allows Spinel
to build properly on platforms that only have `printf()`.
To allow Spinel to build on those platforms, build Spinel with
the following command line argument:
-DSPINEL_PLATFORM_DOESNT_IMPLEMENT_FPRINTF=1
This commit is contained in:
committed by
Jonathan Hui
parent
40e01827ab
commit
02a889566d
+6
-4
@@ -65,11 +65,13 @@ static int spinel_errno_workaround_;
|
||||
#endif // SPINEL_PLATFORM_DOESNT_IMPLEMENT_ERRNO_VAR
|
||||
|
||||
#ifndef assert_printf
|
||||
#if SPINEL_PLATFORM_DOESNT_IMPLEMENT_FPRINTF
|
||||
#define assert_printf(fmt, ...) \
|
||||
fprintf(stderr, \
|
||||
__FILE__ ":%d: " fmt "\n", \
|
||||
__LINE__, \
|
||||
__VA_ARGS__)
|
||||
printf(__FILE__ ":%d: " fmt "\n", __LINE__, __VA_ARGS__)
|
||||
#else // if SPINEL_PLATFORM_DOESNT_IMPLEMENT_FPRINTF
|
||||
#define assert_printf(fmt, ...) \
|
||||
fprintf(stderr, __FILE__ ":%d: " fmt "\n", __LINE__, __VA_ARGS__)
|
||||
#endif // else SPINEL_PLATFORM_DOESNT_IMPLEMENT_FPRINTF
|
||||
#endif
|
||||
|
||||
#ifndef require_action
|
||||
|
||||
Reference in New Issue
Block a user