THRIFT-3873: fix various compiler warnings and overflow errors
THRIFT-3847: change VERSION to PACKAGE_VERSION to avoid conflicts with third party or OS headers

This closes #1128
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index b437860..b86b34c 100644
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -17,9 +17,6 @@
  * under the License.
  */
 
-#define __STDC_FORMAT_MACROS
-#include <inttypes.h>
-
 #include <thrift/concurrency/ThreadManager.h>
 #include <thrift/concurrency/PlatformThreadFactory.h>
 #include <thrift/protocol/TBinaryProtocol.h>
@@ -41,6 +38,13 @@
 #include <thrift/transport/TTransportUtils.h>
 #include "ThriftTest.h"
 
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
 #include <iostream>
 #include <stdexcept>
 #include <sstream>