THRIFT-5663: lib: cpp: usleep was not declared in this scope
Several build failures in Travis resulted from an include-order
problem in `TFileTransport.cpp`. It would probably be better to
simply include the right header files in `PlatformSocket.h`
but it's possible that might slow down compilation.
```
error: 'usleep' was not declared in this scope
..
# define THRIFT_SLEEP_USEC usleep
```
Also fixing the same (potential) problem in `TFDTransport.cpp`.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
diff --git a/lib/cpp/src/thrift/transport/TFDTransport.cpp b/lib/cpp/src/thrift/transport/TFDTransport.cpp
index 0cadcb5..4e28c31 100644
--- a/lib/cpp/src/thrift/transport/TFDTransport.cpp
+++ b/lib/cpp/src/thrift/transport/TFDTransport.cpp
@@ -20,9 +20,6 @@
#include <cerrno>
#include <exception>
-#include <thrift/transport/TFDTransport.h>
-#include <thrift/transport/PlatformSocket.h>
-
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -31,6 +28,9 @@
#include <io.h>
#endif
+#include <thrift/transport/TFDTransport.h>
+#include <thrift/transport/PlatformSocket.h>
+
using std::string;
namespace apache {
diff --git a/lib/cpp/src/thrift/transport/TFileTransport.cpp b/lib/cpp/src/thrift/transport/TFileTransport.cpp
index 3a24e3a..dd7d229 100644
--- a/lib/cpp/src/thrift/transport/TFileTransport.cpp
+++ b/lib/cpp/src/thrift/transport/TFileTransport.cpp
@@ -19,11 +19,6 @@
#include <thrift/thrift-config.h>
-#include <thrift/transport/TFileTransport.h>
-#include <thrift/transport/TTransportUtils.h>
-#include <thrift/transport/PlatformSocket.h>
-#include <thrift/concurrency/FunctionRunner.h>
-
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#else
@@ -49,6 +44,11 @@
#include <io.h>
#endif
+#include <thrift/transport/TFileTransport.h>
+#include <thrift/transport/TTransportUtils.h>
+#include <thrift/transport/PlatformSocket.h>
+#include <thrift/concurrency/FunctionRunner.h>
+
namespace apache {
namespace thrift {
namespace transport {