THRIFT-4515: fix windows build
Client: cpp
diff --git a/lib/cpp/src/thrift/transport/TBufferTransports.cpp b/lib/cpp/src/thrift/transport/TBufferTransports.cpp
index 1d2692d..9ac2f84 100644
--- a/lib/cpp/src/thrift/transport/TBufferTransports.cpp
+++ b/lib/cpp/src/thrift/transport/TBufferTransports.cpp
@@ -368,7 +368,7 @@
       throw TTransportException(TTransportException::BAD_ARGS,
                                 "Internal buffer size overflow");
     }
-    avail = available_write() + (new_size - bufferSize_);
+    avail = available_write() + (static_cast<uint32_t>(new_size) - bufferSize_);
   }
 
   // Allocate into a new pointer so we don't bork ours if it fails.
@@ -382,7 +382,7 @@
   wBase_ = new_buffer + (wBase_ - buffer_);
   wBound_ = new_buffer + new_size;
   buffer_ = new_buffer;
-  bufferSize_ = new_size;
+  bufferSize_ = static_cast<uint32_t>(new_size);
 }
 
 void TMemoryBuffer::writeSlow(const uint8_t* buf, uint32_t len) {
diff --git a/lib/cpp/test/CMakeLists.txt b/lib/cpp/test/CMakeLists.txt
index 9b62cc9..261382f 100644
--- a/lib/cpp/test/CMakeLists.txt
+++ b/lib/cpp/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-#
+#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements. See the NOTICE file
 # distributed with this work for additional information
@@ -19,9 +19,6 @@
 
 include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
 
-add_definitions("-D__STDC_FORMAT_MACROS")
-add_definitions("-D__STDC_LIMIT_MACROS")
-
 if (WITH_DYN_LINK_TEST)
     add_definitions( -DBOOST_TEST_DYN_LINK )
 endif()
diff --git a/lib/cpp/test/concurrency/Tests.cpp b/lib/cpp/test/concurrency/Tests.cpp
index df5099d..fc0ba7f 100644
--- a/lib/cpp/test/concurrency/Tests.cpp
+++ b/lib/cpp/test/concurrency/Tests.cpp
@@ -27,7 +27,7 @@
 
 // The test weight, where 10 is 10 times more threads than baseline
 // and the baseline is optimized for running in valgrind
-static size_t WEIGHT = 10;
+static int WEIGHT = 10;
 
 int main(int argc, char** argv) {