diff options
Diffstat (limited to 'libmisc/include')
-rw-r--r-- | libmisc/include/libmisc/_intercept.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/libmisc/include/libmisc/_intercept.h b/libmisc/include/libmisc/_intercept.h index a264144..87993e4 100644 --- a/libmisc/include/libmisc/_intercept.h +++ b/libmisc/include/libmisc/_intercept.h @@ -7,21 +7,25 @@ #ifndef _LIBMISC__INTERCEPT_H_ #define _LIBMISC__INTERCEPT_H_ -/* pico-sdk/newlib define these to be [[gnu:weak]] already, but - * depending on optimization options glibc might not, and GCC might - * assume it knows what they do and optimize them out. So define our - * own `__lm_` wrappers that GCC/glibc won't interfere with. +#include <stddef.h> /* for size_t */ + +/* pico-sdk/newlib define printf() and abort() to be [[gnu::weak]] + * already, but depending on optimization options glibc might not, and + * GCC might assume it knows what they do and optimize them out. So + * define our own `__lm_` wrappers that GCC/glibc won't interfere + * with. */ [[gnu::format(printf, 1, 2)]] -int __lm_printf(const char *format, ...); +size_t __lm_printf(const char *format, ...); [[noreturn]] void __lm_abort(void); /* __lm_light_printf is expected to have less stack use than regular - * __lm_printf, if possible. */ + * __lm_printf, if possible. + */ [[gnu::format(printf, 1, 2)]] -int __lm_light_printf(const char *format, ...); +size_t __lm_light_printf(const char *format, ...); #endif /* _LIBMISC__INTERCEPT_H_ */ |