From f62cc41fac007f38b661e09d638385241084a540 Mon Sep 17 00:00:00 2001 From: stijn Date: Fri, 20 Mar 2020 11:00:41 +0100 Subject: [PATCH] windows/msvc: Fix warnings regarding function declarations. Fix missing mkdir and gettimeofday declarations, then silence msvc-specific compiler warning C4996: 'The POSIX name for this item is deprecated'. --- ports/unix/modos.c | 3 +++ ports/windows/msvc/common.props | 2 +- ports/windows/msvc/sys/time.h | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/unix/modos.c b/ports/unix/modos.c index 1414f87661..f2784b1d68 100644 --- a/ports/unix/modos.c +++ b/ports/unix/modos.c @@ -33,6 +33,9 @@ #include #include #include +#ifdef _MSC_VER +#include // For mkdir +#endif #include "py/mpconfig.h" #include "py/runtime.h" diff --git a/ports/windows/msvc/common.props b/ports/windows/msvc/common.props index 2545a36469..fcad5aeb6b 100644 --- a/ports/windows/msvc/common.props +++ b/ports/windows/msvc/common.props @@ -13,7 +13,7 @@ $(PyIncDirs);%(AdditionalIncludeDirectories) - _USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions) + _USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions) false Level1 false diff --git a/ports/windows/msvc/sys/time.h b/ports/windows/msvc/sys/time.h index 7c95d409e4..bb41ec36db 100644 --- a/ports/windows/msvc/sys/time.h +++ b/ports/windows/msvc/sys/time.h @@ -29,4 +29,6 @@ // Get the definitions for timeval etc #include +int gettimeofday(struct timeval *tp, struct timezone *tz); + #endif // MICROPY_INCLUDED_WINDOWS_MSVC_SYS_TIME_H