Disable defining (v)snprintf as macro in modern Visual Studio

This commit is contained in:
Andrey Dorozhkin 2020-06-02 16:43:07 +03:00 committed by Wenzel Jakob
parent 4e3d9fea74
commit 1817d2116a

View File

@ -96,6 +96,12 @@
#define PYBIND11_VERSION_MINOR 5 #define PYBIND11_VERSION_MINOR 5
#define PYBIND11_VERSION_PATCH dev1 #define PYBIND11_VERSION_PATCH dev1
/* Don't let Python.h #define (v)snprintf as macro because they are implemented
properly in Visual Studio since 2015. */
#if defined(_MSC_VER) && _MSC_VER >= 1900
# define HAVE_SNPRINTF 1
#endif
/// Include Python header, disable linking to pythonX_d.lib on Windows in debug mode /// Include Python header, disable linking to pythonX_d.lib on Windows in debug mode
#if defined(_MSC_VER) #if defined(_MSC_VER)
# if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 4) # if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 4)