From 880c34926278441924d677dcfd517430402aaacb Mon Sep 17 00:00:00 2001 From: O01eg Date: Fri, 31 May 2019 00:04:26 +0300 Subject: [PATCH] Add fix for replacing snprinf for MSVS version with existing snprintf See: https://bugs.python.org/issue36020 --- patches/2.7/0001-fix-pyerror-msvc.patch | 11 +++++++++++ patches/3.5/0001-fix-pyerror-msvc.patch | 11 +++++++++++ patches/3.6/0001-fix-pyerror-msvc.patch | 11 +++++++++++ 3 files changed, 33 insertions(+) create mode 100644 patches/2.7/0001-fix-pyerror-msvc.patch create mode 100644 patches/3.5/0001-fix-pyerror-msvc.patch create mode 100644 patches/3.6/0001-fix-pyerror-msvc.patch diff --git a/patches/2.7/0001-fix-pyerror-msvc.patch b/patches/2.7/0001-fix-pyerror-msvc.patch new file mode 100644 index 000000000..3537dd1a3 --- /dev/null +++ b/patches/2.7/0001-fix-pyerror-msvc.patch @@ -0,0 +1,11 @@ +--- a/Include/pyerrors.h ++++ b/Include/pyerrors.h +@@ -311,7 +311,7 @@ + not rely on any particular behavior; eventually the C99 defn may + be reliable. + */ +-#if defined(MS_WIN32) && !defined(HAVE_SNPRINTF) ++#if defined(MS_WIN32) && _MSC_VER < 1500 && !defined(HAVE_SNPRINTF) + # define HAVE_SNPRINTF + # define snprintf _snprintf + # define vsnprintf _vsnprintf diff --git a/patches/3.5/0001-fix-pyerror-msvc.patch b/patches/3.5/0001-fix-pyerror-msvc.patch new file mode 100644 index 000000000..3537dd1a3 --- /dev/null +++ b/patches/3.5/0001-fix-pyerror-msvc.patch @@ -0,0 +1,11 @@ +--- a/Include/pyerrors.h ++++ b/Include/pyerrors.h +@@ -311,7 +311,7 @@ + not rely on any particular behavior; eventually the C99 defn may + be reliable. + */ +-#if defined(MS_WIN32) && !defined(HAVE_SNPRINTF) ++#if defined(MS_WIN32) && _MSC_VER < 1500 && !defined(HAVE_SNPRINTF) + # define HAVE_SNPRINTF + # define snprintf _snprintf + # define vsnprintf _vsnprintf diff --git a/patches/3.6/0001-fix-pyerror-msvc.patch b/patches/3.6/0001-fix-pyerror-msvc.patch new file mode 100644 index 000000000..3537dd1a3 --- /dev/null +++ b/patches/3.6/0001-fix-pyerror-msvc.patch @@ -0,0 +1,11 @@ +--- a/Include/pyerrors.h ++++ b/Include/pyerrors.h +@@ -311,7 +311,7 @@ + not rely on any particular behavior; eventually the C99 defn may + be reliable. + */ +-#if defined(MS_WIN32) && !defined(HAVE_SNPRINTF) ++#if defined(MS_WIN32) && _MSC_VER < 1500 && !defined(HAVE_SNPRINTF) + # define HAVE_SNPRINTF + # define snprintf _snprintf + # define vsnprintf _vsnprintf