THRIFT-2044 Util.h uses defines from PlatformSocket but does not include it
Patch: Konrad Grochowski
diff --git a/lib/cpp/src/thrift/concurrency/Util.h b/lib/cpp/src/thrift/concurrency/Util.h
index d63776a..63d80a2 100644
--- a/lib/cpp/src/thrift/concurrency/Util.h
+++ b/lib/cpp/src/thrift/concurrency/Util.h
@@ -29,6 +29,8 @@
#include <sys/time.h>
#endif
+#include <thrift/transport/PlatformSocket.h>
+
namespace apache { namespace thrift { namespace concurrency {
/**
@@ -72,7 +74,7 @@
}
static void toTicks(int64_t& result, int64_t secs, int64_t oldTicks,
- int64_t oldTicksPerSec, int64_t newTicksPerSec) {
+ int64_t oldTicksPerSec, int64_t newTicksPerSec) {
result = secs * newTicksPerSec;
result += oldTicks * newTicksPerSec / oldTicksPerSec;
@@ -85,8 +87,8 @@
* Converts struct THRIFT_TIMESPEC to arbitrary-sized ticks since epoch
*/
static void toTicks(int64_t& result,
- const struct THRIFT_TIMESPEC& value,
- int64_t ticksPerSec) {
+ const struct THRIFT_TIMESPEC& value,
+ int64_t ticksPerSec) {
return toTicks(result, value.tv_sec, value.tv_nsec, NS_PER_S, ticksPerSec);
}
@@ -94,8 +96,8 @@
* Converts struct timeval to arbitrary-sized ticks since epoch
*/
static void toTicks(int64_t& result,
- const struct timeval& value,
- int64_t ticksPerSec) {
+ const struct timeval& value,
+ int64_t ticksPerSec) {
return toTicks(result, value.tv_sec, value.tv_usec, US_PER_S, ticksPerSec);
}
@@ -103,7 +105,7 @@
* Converts struct THRIFT_TIMESPEC to milliseconds
*/
static void toMilliseconds(int64_t& result,
- const struct THRIFT_TIMESPEC& value) {
+ const struct THRIFT_TIMESPEC& value) {
return toTicks(result, value, MS_PER_S);
}
@@ -111,7 +113,7 @@
* Converts struct timeval to milliseconds
*/
static void toMilliseconds(int64_t& result,
- const struct timeval& value) {
+ const struct timeval& value) {
return toTicks(result, value, MS_PER_S);
}