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 963f938..9ccea08 100644
--- a/lib/cpp/src/Thrift.cpp
+++ b/lib/cpp/src/Thrift.cpp
@@ -5,6 +5,7 @@
 // http://developers.facebook.com/thrift/
 
 #include <Thrift.h>
+#include <boost/lexical_cast.hpp>
 #include <protocol/TProtocol.h>
 
 namespace facebook { namespace thrift {
@@ -13,7 +14,7 @@
 
 std::string TOutput::strerror_s(int errno_copy) {
 #ifndef HAVE_STRERROR_R
-  return "errno = " + lexical_cast<string>(errno_copy);
+  return "errno = " + boost::lexical_cast<string>(errno_copy);
 #else  // HAVE_STRERROR_R
 
   char b_errbuf[1024] = { '\0' };
@@ -25,7 +26,7 @@
   if (rv == -1) {
     // strerror_r failed.  omgwtfbbq.
     return "XSI-compliant strerror_r() failed with errno = " +
-      lexical_cast<string>(errno_copy);
+      boost::lexical_cast<std::string>(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 6eb20bb..deaaf78 100644
--- a/lib/cpp/src/Thrift.h
+++ b/lib/cpp/src/Thrift.h
@@ -22,7 +22,6 @@
 #include <vector>
 #include <exception>
 #include <string>
-#include <boost/lexical_cast.hpp>
 
 #include "TLogging.h"
 
diff --git a/lib/cpp/src/protocol/TJSONProtocol.cpp b/lib/cpp/src/protocol/TJSONProtocol.cpp
index d2d56c1..b2ffeac 100644
--- a/lib/cpp/src/protocol/TJSONProtocol.cpp
+++ b/lib/cpp/src/protocol/TJSONProtocol.cpp
@@ -7,6 +7,7 @@
 #include "TJSONProtocol.h"
 
 #include <math.h>
+#include <boost/lexical_cast.hpp>
 #include "TBase64Utils.h"
 #include <transport/TTransportException.h>