You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jk...@apache.org on 2019/05/05 01:52:41 UTC

[thrift] 02/03: THRIFT-4861: Set minimum boost to 1.56 and stop using deprecated boost predef endian header Client: cpp

This is an automated email from the ASF dual-hosted git repository.

jking pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git

commit ee8caca54ef51e05c7eee8d67e3c63cd73081e8a
Author: James E. King III <jk...@apache.org>
AuthorDate: Sat May 4 08:20:59 2019 -0400

    THRIFT-4861: Set minimum boost to 1.56 and stop using deprecated boost predef endian header
    Client: cpp
---
 build/cmake/BoostMacros.cmake           |  2 +-
 configure.ac                            |  2 +-
 debian/control                          |  4 ++--
 doc/install/README.md                   |  4 ++--
 doc/install/centos.md                   |  8 ++++----
 lib/cpp/src/thrift/protocol/TProtocol.h | 17 ++++++++++-------
 6 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/build/cmake/BoostMacros.cmake b/build/cmake/BoostMacros.cmake
index 61be622..cc50b53 100644
--- a/build/cmake/BoostMacros.cmake
+++ b/build/cmake/BoostMacros.cmake
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-set(BOOST_MINREV 1.53)
+set(BOOST_MINREV 1.56)
 
 # we are not ready for the new style link targets introduced in
 # boost 1.70.0 and cmake 3.14.2 which showed up on appveyor in
diff --git a/configure.ac b/configure.ac
index b09c983..5f25a5c 100755
--- a/configure.ac
+++ b/configure.ac
@@ -158,7 +158,7 @@ AM_CONDITIONAL(WITH_AS3, [test "$have_as3" = "yes"])
 AX_THRIFT_LIB(cpp, [C++], yes)
 have_cpp=no
 if test "$with_cpp" = "yes";  then
-  AX_BOOST_BASE([1.53.0])
+  AX_BOOST_BASE([1.56.0])
   if test "x$succeeded" = "xyes" ; then
     AC_SUBST([BOOST_LIB_DIR], [$(echo "$BOOST_LDFLAGS" | sed -e 's/^\-L//')])
     AC_SUBST([BOOST_CHRONO_LDADD], [$(echo "$BOOST_LIB_DIR/libboost_chrono.a")])
diff --git a/debian/control b/debian/control
index 9de66fc..414a815 100644
--- a/debian/control
+++ b/debian/control
@@ -3,11 +3,11 @@ Section: devel
 Priority: extra
 Build-Depends: debhelper (>= 9), build-essential, mono-mcs, python-dev, ant,
     mono-devel,  libmono-system-web4.0-cil, erlang-base, ruby-dev | ruby1.9.1-dev, ruby-bundler ,autoconf, automake,
-    pkg-config, libtool, bison, flex, libboost-dev | libboost1.53-dev | libboost1.63-all-dev,
+    pkg-config, libtool, bison, flex, libboost-dev | libboost1.56-dev | libboost1.63-all-dev,
     python-all, python-setuptools, python-all-dev, python-all-dbg,
     python3-all, python3-setuptools, python3-all-dev, python3-all-dbg,
     openjdk-8-jdk | openjdk-8-jdk-headless | openjdk-11-jdk | openjdk-11-jdk-headless | default-jdk,
-    libboost-test-dev | libboost-test1.53-dev | libboost-test1.63-dev, libevent-dev, libssl-dev, perl (>= 5.8.0-7),
+    libboost-test-dev | libboost-test1.56-dev | libboost-test1.63-dev, libevent-dev, libssl-dev, perl (>= 5.8.0-7),
     php (>= 5), php-dev (>= 5), libglib2.0-dev, qtchooser, qtbase5-dev-tools
 Maintainer: Thrift Developer's <de...@thrift.apache.org>
 Homepage: http://thrift.apache.org/
diff --git a/doc/install/README.md b/doc/install/README.md
index 22231cd..e48cc4a 100644
--- a/doc/install/README.md
+++ b/doc/install/README.md
@@ -3,7 +3,7 @@
 * A relatively POSIX-compliant *NIX system
     * Cygwin or MinGW can be used on Windows (but there are better options, see below)
 * g++ 4.2
-* boost 1.53.0
+* boost 1.56.0
 * Runtime libraries for lex and yacc might be needed for the compiler.
 
 ## Requirements for building from source
@@ -23,7 +23,7 @@
 These are only required if you choose to build the libraries for the given language
 
 * C++
-    * Boost 1.53.0
+    * Boost 1.56.0
     * libevent (optional, to build the nonblocking server)
     * zlib (optional)
 * Java
diff --git a/doc/install/centos.md b/doc/install/centos.md
index 04932c2..18282a3 100644
--- a/doc/install/centos.md
+++ b/doc/install/centos.md
@@ -54,11 +54,11 @@ If you will be developing Apache Thrift clients/servers in C++ you will also nee
 
 	sudo yum -y install libevent-devel zlib-devel openssl-devel
 
-### Upgrade Boost >= 1.53
+### Upgrade Boost >= 1.56
 
-	wget http://sourceforge.net/projects/boost/files/boost/1.53.0/boost_1_53_0.tar.gz
-	tar xvf boost_1_53_0.tar.gz
-	cd boost_1_53_0
+	wget http://sourceforge.net/projects/boost/files/boost/1.56.0/boost_1_56_0.tar.gz
+	tar xvf boost_1_56_0.tar.gz
+	cd boost_1_56_0
 	./bootstrap.sh
 	sudo ./b2 install
 
diff --git a/lib/cpp/src/thrift/protocol/TProtocol.h b/lib/cpp/src/thrift/protocol/TProtocol.h
index 7566a25..df9c5c3 100644
--- a/lib/cpp/src/thrift/protocol/TProtocol.h
+++ b/lib/cpp/src/thrift/protocol/TProtocol.h
@@ -88,15 +88,18 @@ static inline To bitwise_cast(From from) {
 #  define __THRIFT_LITTLE_ENDIAN LITTLE_ENDIAN
 #  define __THRIFT_BIG_ENDIAN BIG_ENDIAN
 # else
-#  include <boost/config.hpp>
-#  include <boost/detail/endian.hpp>
-#  define __THRIFT_BYTE_ORDER BOOST_BYTE_ORDER
+#  include <boost/predef/other/endian.h>
+#  if BOOST_ENDIAN_BIG_BYTE
+#    define __THRIFT_BYTE_ORDER 4321
+#    define __THRIFT_LITTLE_ENDIAN 0
+#    define __THRIFT_BIG_ENDIAN __THRIFT_BYTE_ORDER
+#  elif BOOST_ENDIAN_LITTLE_BYTE
+#    define __THRIFT_BYTE_ORDER 1234
+#    define __THRIFT_LITTLE_ENDIAN __THRIFT_BYTE_ORDER
+#    define __THRIFT_BIG_ENDIAN 0
+#  endif
 #  ifdef BOOST_LITTLE_ENDIAN
-#   define __THRIFT_LITTLE_ENDIAN __THRIFT_BYTE_ORDER
-#   define __THRIFT_BIG_ENDIAN 0
 #  else
-#   define __THRIFT_LITTLE_ENDIAN 0
-#   define __THRIFT_BIG_ENDIAN __THRIFT_BYTE_ORDER
 #  endif
 # endif
 #endif