--- thrift-0.13.0-orig/compiler/cpp/src/thrift/main.cc	2019-10-11 01:34:34.000000000 +0300
+++ thrift-0.13.0/compiler/cpp/src/thrift/main.cc	2020-02-12 21:59:42.022296935 +0200
@@ -40,6 +40,7 @@
 #include <limits.h>
 
 #ifdef _WIN32
+#include <WinSock2.h>
 #include <windows.h> /* for GetFullPathName */
 #endif

--- thrift-0.13.0-orig/compiler/cpp/src/thrift/thriftl.ll	2019-10-11 01:34:27.000000000 +0300
+++ thrift-0.13.0/compiler/cpp/src/thrift/thriftl.ll	2020-02-12 22:38:55.213395854 +0200
@@ -59,6 +59,7 @@
 #include <stdlib.h>
 
 #ifdef _MSC_VER
+#include <io.h>  // isatty
 #include "thrift/windows/config.h"
 #endif
 #include "thrift/main.h"

--- thrift-0.13.0-orig/compiler/cpp/src/thrift/generate/t_erl_generator.cc	2019-10-11 01:34:34.000000000 +0300
+++ thrift-0.13.0/compiler/cpp/src/thrift/generate/t_erl_generator.cc	2020-02-12 22:43:20.487425216 +0200
@@ -31,6 +31,12 @@
 #include "thrift/version.h"
 #include "thrift/generate/t_generator.h"
 
+#ifdef _MSC_VER
+#ifdef max
+#undef max
+#endif
+#endif
+
 using std::map;
 using std::ofstream;
 using std::ostream;

--- thrift-0.13.0-orig/compiler/cpp/src/thrift/generate/t_go_generator.cc	2019-10-11 01:34:34.000000000 +0300
+++ thrift-0.13.0/compiler/cpp/src/thrift/generate/t_go_generator.cc	2020-02-12 22:50:45.795831019 +0200
@@ -42,6 +42,12 @@
 #include "thrift/version.h"
 #include "thrift/generate/t_generator.h"
 
+#ifdef _MSC_VER
+#ifdef max
+#undef max
+#endif
+#endif
+
 using std::map;
 using std::ostream;
 using std::ostringstream;

--- thrift-0.13.0-orig/compiler/cpp/src/thrift/generate/t_py_generator.cc	2019-10-11 01:34:34.000000000 +0300
+++ thrift-0.13.0/compiler/cpp/src/thrift/generate/t_py_generator.cc	2020-02-12 22:56:20.302405797 +0200
@@ -242,7 +242,8 @@
   std::string declare_argument(t_field* tfield);
   std::string render_field_default_value(t_field* tfield);
   std::string type_name(t_type* ttype);
-  std::string function_signature(t_function* tfunction, bool interface = false);
+  std::string function_signature(t_function* tfunction,
+                                 bool interface_ = false);
   std::string argument_list(t_struct* tstruct,
                             std::vector<std::string>* pre = NULL,
                             std::vector<std::string>* post = NULL);
@@ -2615,12 +2616,12 @@
  * @param tfunction Function definition
  * @return String of rendered function definition
  */
-string t_py_generator::function_signature(t_function* tfunction, bool interface) {
+string t_py_generator::function_signature(t_function* tfunction, bool interface_) {
   vector<string> pre;
   vector<string> post;
   string signature = tfunction->get_name() + "(";
 
-  if (!(gen_zope_interface_ && interface)) {
+  if (!(gen_zope_interface_ && interface_)) {
     pre.emplace_back("self");
   }
 

--- thrift-0.13.0-orig/compiler/cpp/src/thrift/thrifty.yy	2019-03-16 18:54:19.000000000 +0200
+++ thrift-0.13.0/compiler/cpp/src/thrift/thrifty.yy	2020-02-12 23:15:10.639304746 +0200
@@ -36,11 +36,7 @@
 #endif
 #include <stdio.h>
 #include <string.h>
-#ifndef _MSC_VER
 #include <inttypes.h>
-#else
-#include <stdint.h>
-#endif
 #include <limits.h>
 #ifdef _MSC_VER
 #include "thrift/windows/config.h"

