diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-16 18:11:42 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-16 18:20:49 +0200 |
commit | 44739e280e81c2ebf2491818eb5a6d0ef30c7c6b (patch) | |
tree | b3dd81094d08289663452e9c9b744b37750e3869 /unix/main.c | |
parent | 1b694c082eeda7b147ac7873964a3dd7bb9583a3 (diff) | |
download | micropython-44739e280e81c2ebf2491818eb5a6d0ef30c7c6b.tar.gz micropython-44739e280e81c2ebf2491818eb5a6d0ef30c7c6b.zip |
Make DEBUG_printf() a proper function, implementation is port-dependent.
In particular, unix outputs to stderr, to allow to run testsuite against
micropython built with debug output (by redirecting stderr to /dev/null).
Diffstat (limited to 'unix/main.c')
-rw-r--r-- | unix/main.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/unix/main.c b/unix/main.c index 8e6a76bbad..9d07b842b1 100644 --- a/unix/main.c +++ b/unix/main.c @@ -2,6 +2,7 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> +#include <stdarg.h> #include "nlr.h" #include "misc.h" @@ -374,3 +375,11 @@ uint mp_import_stat(const char *path) { } return MP_IMPORT_STAT_NO_EXIST; } + +int DEBUG_printf(const char *fmt, ...) { + va_list ap; + va_start(ap, fmt); + int ret = vfprintf(stderr, fmt, ap); + va_end(ap); + return ret; +} |