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.
This commit is contained in:
stijn 2018-07-03 12:30:42 +02:00 committed by Damien George
parent 8ad30fa433
commit 106e594580
3 changed files with 3 additions and 0 deletions

View File

@ -28,6 +28,7 @@ endif
# source files # source files
SRC_C = \ SRC_C = \
lib/utils/printf.c \
ports/unix/main.c \ ports/unix/main.c \
ports/unix/file.c \ ports/unix/file.c \
ports/unix/input.c \ ports/unix/input.c \

View File

@ -121,6 +121,7 @@ extern const struct _mp_print_t mp_stderr_print;
#ifdef _MSC_VER #ifdef _MSC_VER
#define MICROPY_GCREGS_SETJMP (1) #define MICROPY_GCREGS_SETJMP (1)
#define MICROPY_USE_INTERNAL_PRINTF (0)
#endif #endif
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1) #define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)

View File

@ -6,6 +6,7 @@
<ClCompile Include="$(PyBaseDir)ports\windows\*.c" /> <ClCompile Include="$(PyBaseDir)ports\windows\*.c" />
<ClCompile Include="$(PyBaseDir)ports\windows\msvc\*.c" /> <ClCompile Include="$(PyBaseDir)ports\windows\msvc\*.c" />
<ClCompile Include="$(PyBaseDir)lib\mp-readline\*.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\file.c"/>
<ClCompile Include="$(PyBaseDir)ports\unix\gccollect.c"/> <ClCompile Include="$(PyBaseDir)ports\unix\gccollect.c"/>
<ClCompile Include="$(PyBaseDir)ports\unix\input.c"/> <ClCompile Include="$(PyBaseDir)ports\unix\input.c"/>