summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2018-07-03 12:30:42 +0200
committerDamien George <damien.p.george@gmail.com>2018-07-05 19:44:18 +1000
commit106e594580d4de2d680c7ceefc7a1c331b4de3dd (patch)
tree6a2a000b06c389368e92d05db2c47ab138162037
parent8ad30fa433ec917aee1780abfa5ddea7a86c9596 (diff)
downloadmicropython-106e594580d4de2d680c7ceefc7a1c331b4de3dd.tar.gz
micropython-106e594580d4de2d680c7ceefc7a1c331b4de3dd.zip
windows: Make printing of debugging info work out of the box.
Printing debugging info by defining MICROPY_DEBUG_VERBOSE expects a definition of the DEBUG_printf function which is readily available in printf.c so include that file in the build. Before this patch one would have to manually provide such definition which is tedious. For the msvc port disable MICROPY_USE_INTERNAL_PRINTF though: the linker provides no (easy) way to replace printf with the custom version as defined in printf.c.
-rw-r--r--ports/windows/Makefile1
-rw-r--r--ports/windows/mpconfigport.h1
-rw-r--r--ports/windows/msvc/sources.props1
3 files changed, 3 insertions, 0 deletions
diff --git a/ports/windows/Makefile b/ports/windows/Makefile
index 725cb686e5..61a6b2844c 100644
--- a/ports/windows/Makefile
+++ b/ports/windows/Makefile
@@ -28,6 +28,7 @@ endif
# source files
SRC_C = \
+ lib/utils/printf.c \
ports/unix/main.c \
ports/unix/file.c \
ports/unix/input.c \
diff --git a/ports/windows/mpconfigport.h b/ports/windows/mpconfigport.h
index 9db6d31ce8..1107a538e0 100644
--- a/ports/windows/mpconfigport.h
+++ b/ports/windows/mpconfigport.h
@@ -121,6 +121,7 @@ extern const struct _mp_print_t mp_stderr_print;
#ifdef _MSC_VER
#define MICROPY_GCREGS_SETJMP (1)
+#define MICROPY_USE_INTERNAL_PRINTF (0)
#endif
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
diff --git a/ports/windows/msvc/sources.props b/ports/windows/msvc/sources.props
index b85295ebc0..5c2076f1ea 100644
--- a/ports/windows/msvc/sources.props
+++ b/ports/windows/msvc/sources.props
@@ -6,6 +6,7 @@
<ClCompile Include="$(PyBaseDir)ports\windows\*.c" />
<ClCompile Include="$(PyBaseDir)ports\windows\msvc\*.c" />
<ClCompile Include="$(PyBaseDir)lib\mp-readline\*.c" />
+ <ClCompile Include="$(PyBaseDir)lib\utils\printf.c" />
<ClCompile Include="$(PyBaseDir)ports\unix\file.c"/>
<ClCompile Include="$(PyBaseDir)ports\unix\gccollect.c"/>
<ClCompile Include="$(PyBaseDir)ports\unix\input.c"/>