1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

MSVC: #define inline and restrict only when needed.

This also drops the check for _WIN32 as that shouldn't be needed.
This commit is contained in:
Lasse Collin 2023-09-12 23:34:31 +03:00
parent af66cd5859
commit 8c2d197c94

View file

@ -151,13 +151,16 @@ typedef unsigned char _Bool;
#include <string.h> #include <string.h>
// As of MSVC 2013, inline and restrict are supported with // Visual Studio 2013 update 2 supports only __inline, not inline.
// non-standard keywords. // MSVC v19.0 / VS 2015 and newer support both.
#if defined(_WIN32) && defined(_MSC_VER) //
# ifndef inline // MSVC v19.27 (VS 2019 version 16.7) added support for restrict.
// Older ones support only __restrict.
#ifdef _MSC_VER
# if _MSC_VER < 1900 && !defined(inline)
# define inline __inline # define inline __inline
# endif # endif
# ifndef restrict # if _MSC_VER < 1927 && !defined(restrict)
# define restrict __restrict # define restrict __restrict
# endif # endif
#endif #endif