Skip to content

Commit

Permalink
Disable defining (v)snprintf as macro in modern Visual Studio
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Dorozhkin authored and wjakob committed Jun 4, 2020
1 parent 4e3d9fe commit 1817d21
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/pybind11/detail/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@
#define PYBIND11_VERSION_MINOR 5
#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
#if defined(_MSC_VER)
# if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 4)
Expand Down

0 comments on commit 1817d21

Please sign in to comment.