summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Friedt <cfriedt@meta.com>2022-10-26 20:17:01 -0400
committerJens Geyer <Jens-G@users.noreply.github.com>2022-11-20 12:02:44 +0100
commit8f83e462502a57456ab726ac64ab4dc3ca4d9b00 (patch)
tree1e1ef4da269f2f63480f7dc97fbec9e2623c1a8a
parentc49544802442100bd6fca47f38da1c228baad524 (diff)
downloadthrift-8f83e462502a57456ab726ac64ab4dc3ca4d9b00.tar.gz
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>
-rw-r--r--lib/cpp/src/thrift/transport/TFDTransport.cpp6
-rw-r--r--lib/cpp/src/thrift/transport/TFileTransport.cpp10
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/cpp/src/thrift/transport/TFDTransport.cpp b/lib/cpp/src/thrift/transport/TFDTransport.cpp
index 0cadcb553..4e28c318b 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 3a24e3a22..dd7d22925 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 {