From: David Reiss Date: Fri, 11 Apr 2008 22:36:31 +0000 (+0000) Subject: Fix Thrift.cpp for non-Linux systems. X-Git-Tag: 0.2.0~816 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=a1771097520d57cd84dcd5e06df6e5e4fae5e5c1;p=common%2Fthrift.git Fix Thrift.cpp for non-Linux systems. - Add some missing namespace qualifiers that are not used in the glibc case. - Move an include from Thrift.h to Thrift.cpp. - Include boost/lexical_cast.hpp in TJSONProtocol, in case we ever eliminate it from our header files. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665656 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/cpp/src/Thrift.cpp b/lib/cpp/src/Thrift.cpp index 963f9389..9ccea08c 100644 --- a/lib/cpp/src/Thrift.cpp +++ b/lib/cpp/src/Thrift.cpp @@ -5,6 +5,7 @@ // http://developers.facebook.com/thrift/ #include +#include #include namespace facebook { namespace thrift { @@ -13,7 +14,7 @@ TOutput GlobalOutput; std::string TOutput::strerror_s(int errno_copy) { #ifndef HAVE_STRERROR_R - return "errno = " + lexical_cast(errno_copy); + return "errno = " + boost::lexical_cast(errno_copy); #else // HAVE_STRERROR_R char b_errbuf[1024] = { '\0' }; @@ -25,7 +26,7 @@ std::string TOutput::strerror_s(int errno_copy) { if (rv == -1) { // strerror_r failed. omgwtfbbq. return "XSI-compliant strerror_r() failed with errno = " + - lexical_cast(errno_copy); + boost::lexical_cast(errno_copy); } #endif // Can anyone prove that explicit cast is probably not necessary diff --git a/lib/cpp/src/Thrift.h b/lib/cpp/src/Thrift.h index 6eb20bb8..deaaf78f 100644 --- a/lib/cpp/src/Thrift.h +++ b/lib/cpp/src/Thrift.h @@ -22,7 +22,6 @@ #include #include #include -#include #include "TLogging.h" diff --git a/lib/cpp/src/protocol/TJSONProtocol.cpp b/lib/cpp/src/protocol/TJSONProtocol.cpp index d2d56c18..b2ffeac1 100644 --- a/lib/cpp/src/protocol/TJSONProtocol.cpp +++ b/lib/cpp/src/protocol/TJSONProtocol.cpp @@ -7,6 +7,7 @@ #include "TJSONProtocol.h" #include +#include #include "TBase64Utils.h" #include