diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 5c6751868df489..b0075bffa29d77 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -323,7 +323,8 @@ PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason( not rely on any particular behavior; eventually the C99 defn may be reliable. */ -#if defined(MS_WIN32) && !defined(HAVE_SNPRINTF) +#if defined(MS_WIN32) && !defined(HAVE_SNPRINTF) && \ + defined(_MSC_VER) && _MSC_VER < 1900 # define HAVE_SNPRINTF # define snprintf _snprintf # define vsnprintf _vsnprintf diff --git a/Misc/NEWS.d/next/Windows/2019-02-18-12-02-32.bpo-36020.CGyW--.rst b/Misc/NEWS.d/next/Windows/2019-02-18-12-02-32.bpo-36020.CGyW--.rst new file mode 100644 index 00000000000000..d8254f9a1ec19d --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2019-02-18-12-02-32.bpo-36020.CGyW--.rst @@ -0,0 +1,2 @@ +Define snprintf in pyerrors.h for the previous versions of MSVC++ 14.0. +Patch by Stéphane Wirtel