THRIFT-4579: Move up to Ubuntu Bionic for CI builds
make dlang library compatible with openssl-1.1 for Ubuntu Bionic
Requires an upstream deimos update to be compatible.
diff --git a/lib/cpp/src/thrift/stdcxx.h b/lib/cpp/src/thrift/stdcxx.h
index 5113940..c8cabf5 100644
--- a/lib/cpp/src/thrift/stdcxx.h
+++ b/lib/cpp/src/thrift/stdcxx.h
@@ -21,6 +21,7 @@
#define _THRIFT_STDCXX_H_ 1
#include <boost/config.hpp>
+#include <boost/version.hpp>
///////////////////////////////////////////////////////////////////
//
@@ -29,7 +30,11 @@
///////////////////////////////////////////////////////////////////
#if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) || (defined(_MSC_VER) && _MSC_VER < 1800) || defined(FORCE_BOOST_FUNCTIONAL)
+#if (BOOST_VERSION <= 106500)
#include <boost/tr1/functional.hpp>
+#else
+#include <tr1/functional>
+#endif
#define _THRIFT_FUNCTIONAL_TR1_ 1
#endif
diff --git a/lib/cpp/test/TFileTransportTest.cpp b/lib/cpp/test/TFileTransportTest.cpp
index 700a1ac..d0c26b3 100644
--- a/lib/cpp/test/TFileTransportTest.cpp
+++ b/lib/cpp/test/TFileTransportTest.cpp
@@ -53,20 +53,6 @@
* Helper code
**************************************************************************/
-// Provide BOOST_WARN_LT() and BOOST_WARN_GT(), in case we're compiled
-// with an older version of boost
-#ifndef BOOST_WARN_LT
-#define BOOST_WARN_CMP(a, b, op, check_fn) \
- check_fn((a)op(b), \
- "check " BOOST_STRINGIZE(a) " " BOOST_STRINGIZE(op) " " BOOST_STRINGIZE( \
- b) " failed: " BOOST_STRINGIZE(a) "=" \
- << (a) << " " BOOST_STRINGIZE(b) "=" << (b))
-
-#define BOOST_WARN_LT(a, b) BOOST_WARN_CMP(a, b, <, BOOST_WARN_MESSAGE)
-#define BOOST_WARN_GT(a, b) BOOST_WARN_CMP(a, b, >, BOOST_WARN_MESSAGE)
-#define BOOST_WARN_LT(a, b) BOOST_WARN_CMP(a, b, <, BOOST_WARN_MESSAGE)
-#endif // BOOST_WARN_LT
-
/**
* Class to record calls to fsync
*/
@@ -218,7 +204,7 @@
// If any attempt takes more than 500ms, treat that as a failure.
// Treat this as a fatal failure, so we'll return now instead of
// looping over a very slow operation.
- BOOST_WARN_LT(delta, 500000);
+ BOOST_WARN( delta < 500000 );
// Normally, it takes less than 100ms on my dev box.
// However, if the box is heavily loaded, some of the test runs
@@ -296,7 +282,7 @@
for (FsyncLog::CallList::const_iterator it = calls->begin(); it != calls->end(); ++it) {
if (prev_time) {
int delta = time_diff(prev_time, &it->time);
- BOOST_WARN_LT(delta, max_allowed_delta);
+ BOOST_WARN( delta < max_allowed_delta );
}
prev_time = &it->time;
}
@@ -346,7 +332,7 @@
// Use a fatal fail so we break out early, rather than continuing to make
// many more slow flush() calls.
int delta = time_diff(&start, &now);
- BOOST_WARN_LT(delta, 2000000);
+ BOOST_WARN( delta < 2000000 );
}
}