diff options
| author | stijn | 2020-03-20 11:00:41 +0100 |
|---|---|---|
| committer | Damien George | 2020-03-25 00:38:11 +1100 |
| commit | f62cc41fac007f38b661e09d638385241084a540 (patch) | |
| tree | 83d9454eb7d015e6164dca5aef0ffb33abdaf9e7 | |
| parent | 1b3e0e10b927b98f6ebaf62503220dfae0e599d9 (diff) | |
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'.
| -rw-r--r-- | ports/unix/modos.c | 3 | ||||
| -rw-r--r-- | ports/windows/msvc/common.props | 2 | ||||
| -rw-r--r-- | ports/windows/msvc/sys/time.h | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/ports/unix/modos.c b/ports/unix/modos.c index 1414f8766..f2784b1d6 100644 --- a/ports/unix/modos.c +++ b/ports/unix/modos.c @@ -33,6 +33,9 @@ #include <stdlib.h> #include <string.h> #include <dirent.h> +#ifdef _MSC_VER +#include <direct.h> // 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 2545a3646..fcad5aeb6 100644 --- a/ports/windows/msvc/common.props +++ b/ports/windows/msvc/common.props @@ -13,7 +13,7 @@ <ItemDefinitionGroup> <ClCompile> <AdditionalIncludeDirectories>$(PyIncDirs);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <SDLCheck>false</SDLCheck> <WarningLevel>Level1</WarningLevel> <ExceptionHandling>false</ExceptionHandling> diff --git a/ports/windows/msvc/sys/time.h b/ports/windows/msvc/sys/time.h index 7c95d409e..bb41ec36d 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 <Winsock2.h> +int gettimeofday(struct timeval *tp, struct timezone *tz); + #endif // MICROPY_INCLUDED_WINDOWS_MSVC_SYS_TIME_H |
