From 545ab8af08868cd3136f9a5e91ff69dfcf5e3184 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 19 Apr 2019 11:33:02 +0100 Subject: [PATCH] Fix Visual Studio 2015 and later compilation errors due to snprintf macro definition. Closes #1508 --- CHANGES.current | 4 ++++ Lib/chicken/chickenrun.swg | 2 +- Lib/swigfragments.swg | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index 9633d07e7..d36f43c41 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -7,6 +7,10 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/ Version 4.0.0 (in progress) =========================== +2019-04-19: pbecherer + [Tcl] Fix Visual Studio 2015 and later compilation errors due to snprintf macro + definition. + 2019-04-09: wsfulton [C#] Fix FxCop warning CA2002 in SWIGPendingException - a lock on a reference of type 'Type'. diff --git a/Lib/chicken/chickenrun.swg b/Lib/chicken/chickenrun.swg index d4255c365..bb14b4bc9 100644 --- a/Lib/chicken/chickenrun.swg +++ b/Lib/chicken/chickenrun.swg @@ -7,7 +7,7 @@ #include #include #include -#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) +#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__BORLANDC__) || defined(_WATCOM) # ifndef snprintf # define snprintf _snprintf # endif diff --git a/Lib/swigfragments.swg b/Lib/swigfragments.swg index 63bb6c8f4..2cbef7cce 100644 --- a/Lib/swigfragments.swg +++ b/Lib/swigfragments.swg @@ -35,7 +35,7 @@ %fragment("", "header") %{ #include -#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) +#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__BORLANDC__) || defined(_WATCOM) # ifndef snprintf # define snprintf _snprintf # endif