Thrift-1846:Restore socket.h header to support builds with Android NDK
Client: cpp
Patch: Nicolas Trésegnie
moves the <sys/socket.h> include from TSocket.h to the .cpp to minimize the risk of hidden dependencies.
diff --git a/lib/cpp/src/thrift/transport/TSocket.cpp b/lib/cpp/src/thrift/transport/TSocket.cpp
index d2eb30e..e59f4a1 100644
--- a/lib/cpp/src/thrift/transport/TSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSocket.cpp
@@ -22,6 +22,9 @@
#endif
#include <cstring>
#include <sstream>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
diff --git a/lib/cpp/src/thrift/transport/TSocket.h b/lib/cpp/src/thrift/transport/TSocket.h
index ff5e541..b916a3e 100644
--- a/lib/cpp/src/thrift/transport/TSocket.h
+++ b/lib/cpp/src/thrift/transport/TSocket.h
@@ -29,9 +29,6 @@
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif