From e2ac8bb3f14b076a29244022865e3b47c6c0800a Mon Sep 17 00:00:00 2001 From: Delio Brignoli Date: Sun, 21 Aug 2016 11:33:37 +0200 Subject: py: Add MICROPY_USE_INTERNAL_PRINTF option, defaults to enabled. This new config option allows to control whether MicroPython uses its own internal printf or not (if not, an external one should be linked in). Accompanying this new option is the inclusion of lib/utils/printf.c in the core list of source files, so that ports no longer need to include it themselves. --- lib/utils/printf.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/utils/printf.c') diff --git a/lib/utils/printf.c b/lib/utils/printf.c index 308525b6e..303edfcca 100644 --- a/lib/utils/printf.c +++ b/lib/utils/printf.c @@ -24,6 +24,10 @@ * THE SOFTWARE. */ +#include "py/mpconfig.h" + +#if MICROPY_USE_INTERNAL_PRINTF + #include #include #include @@ -127,3 +131,5 @@ int snprintf(char *str, size_t size, const char *fmt, ...) { va_end(ap); return ret; } + +#endif //MICROPY_USE_INTERNAL_PRINTF -- cgit v1.2.3