Skip to content

Commit 81181f1

Browse files
feat: add vcore_debug function
This does the same as core_debug, but (like printf vs vprintf) accepts an already processed va_list to allow other vararg functions to forward their argument lists to this function.
1 parent 30d2e59 commit 81181f1

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Diff for: cores/arduino/core_debug.c

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
// Ensure inline functions have a definition emitted for when they are
44
// not inlined (needed for C functions only)
55
extern void core_debug(const char *format, ...);
6+
extern void vcore_debug(const char *format, va_list args);

Diff for: cores/arduino/core_debug.h

+10
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ inline void core_debug(const char *format, ...)
2828
#endif /* NDEBUG */
2929
}
3030

31+
inline void vcore_debug(const char *format, va_list args)
32+
{
33+
#if !defined(NDEBUG)
34+
vfprintf(stderr, format, args);
35+
#else
36+
(void)(format);
37+
(void)(args);
38+
#endif /* NDEBUG */
39+
}
40+
3141
#ifdef __cplusplus
3242
}
3343
#endif

0 commit comments

Comments
 (0)