vlc_fixups: do warn about "deprecated" ANSI calls on Windows GDK

These functions are not available when linking, so we should avoid using them.
Also mingw-w64 understands _CRT_NONSTDC_NO_DEPRECATE but not
_CRT_NONSTDC_NO_WARNINGS.
This commit is contained in:
Steve Lhomme 2023-02-22 05:56:38 -08:00
parent f8cd81e4f5
commit 6946b06a17
2 changed files with 10 additions and 3 deletions

View File

@ -9,8 +9,12 @@
// Windows is not a real POSIX system and doesn't provide this header
// provide a dummy one so the code can compile
#if defined(_GAMING_XBOX_SCARLETT) || defined(_GAMING_XBOX_XBOXONE) || defined(_XBOX_ONE)
# define _CRT_DECLARE_NONSTDC_NAMES 0
#else
// many functions commonly found in unistd.h are found in io.h and process.h
#define _CRT_DECLARE_NONSTDC_NAMES 1
# define _CRT_DECLARE_NONSTDC_NAMES 1
#endif
#include <io.h>
#include <process.h>

View File

@ -28,8 +28,11 @@
#if defined(_MSC_VER)
// disable common warnings when compiling POSIX code
#ifndef _CRT_NONSTDC_NO_WARNINGS
#define _CRT_NONSTDC_NO_WARNINGS 1
#ifndef _CRT_NONSTDC_NO_DEPRECATE
// the POSIX variants are not available in the GDK
# if !(defined(_GAMING_XBOX_SCARLETT) || defined(_GAMING_XBOX_XBOXONE) || defined(_XBOX_ONE))
# define _CRT_NONSTDC_NO_DEPRECATE
# endif
#endif
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS 1