You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2011/09/05 21:15:53 UTC

svn commit: r1165400 - in /thrift/trunk: ./ lib/cpp/src/ lib/cpp/src/concurrency/ lib/cpp/src/protocol/ lib/cpp/src/server/ lib/cpp/src/transport/ lib/cpp/test/

Author: roger
Date: Mon Sep  5 19:15:53 2011
New Revision: 1165400

URL: http://svn.apache.org/viewvc?rev=1165400&view=rev
Log:
THRIFT-1320 Consistency of configure generated config.h
Patch: Alexandre Parenteau

Modified:
    thrift/trunk/configure.ac
    thrift/trunk/lib/cpp/src/Thrift.h
    thrift/trunk/lib/cpp/src/concurrency/Mutex.cpp
    thrift/trunk/lib/cpp/src/concurrency/Util.cpp
    thrift/trunk/lib/cpp/src/concurrency/Util.h
    thrift/trunk/lib/cpp/src/protocol/TProtocol.h
    thrift/trunk/lib/cpp/src/server/TNonblockingServer.cpp
    thrift/trunk/lib/cpp/src/server/TServer.cpp
    thrift/trunk/lib/cpp/src/transport/TFDTransport.h
    thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp
    thrift/trunk/lib/cpp/src/transport/TSSLSocket.cpp
    thrift/trunk/lib/cpp/src/transport/TServerSocket.cpp
    thrift/trunk/lib/cpp/src/transport/TSimpleFileTransport.cpp
    thrift/trunk/lib/cpp/src/transport/TSocket.cpp
    thrift/trunk/lib/cpp/src/transport/TSocket.h
    thrift/trunk/lib/cpp/test/Benchmark.cpp
    thrift/trunk/lib/cpp/test/TFileTransportTest.cpp

Modified: thrift/trunk/configure.ac
URL: http://svn.apache.org/viewvc/thrift/trunk/configure.ac?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/configure.ac (original)
+++ thrift/trunk/configure.ac Mon Sep  5 19:15:53 2011
@@ -298,6 +298,9 @@ AC_CHECK_HEADERS([stddef.h])
 AC_CHECK_HEADERS([stdlib.h])
 AC_CHECK_HEADERS([sys/socket.h])
 AC_CHECK_HEADERS([sys/time.h])
+AC_CHECK_HEADERS([sys/un.h])
+AC_CHECK_HEADERS([sys/poll.h])
+AC_CHECK_HEADERS([sys/resource.h])
 AC_CHECK_HEADERS([unistd.h])
 AC_CHECK_HEADERS([libintl.h])
 AC_CHECK_HEADERS([malloc.h])

Modified: thrift/trunk/lib/cpp/src/Thrift.h
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/Thrift.h?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/Thrift.h (original)
+++ thrift/trunk/lib/cpp/src/Thrift.h Mon Sep  5 19:15:53 2011
@@ -27,7 +27,9 @@
 #include <assert.h>
 
 #include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
 #ifdef HAVE_INTTYPES_H
 #include <inttypes.h>
 #endif

Modified: thrift/trunk/lib/cpp/src/concurrency/Mutex.cpp
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/concurrency/Mutex.cpp?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/concurrency/Mutex.cpp (original)
+++ thrift/trunk/lib/cpp/src/concurrency/Mutex.cpp Mon Sep  5 19:15:53 2011
@@ -17,11 +17,16 @@
  * under the License.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include "Mutex.h"
 #include "Util.h"
 
 #include <assert.h>
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #include <signal.h>
 
 using boost::shared_ptr;

Modified: thrift/trunk/lib/cpp/src/concurrency/Util.cpp
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/concurrency/Util.cpp?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/concurrency/Util.cpp (original)
+++ thrift/trunk/lib/cpp/src/concurrency/Util.cpp Mon Sep  5 19:15:53 2011
@@ -17,15 +17,15 @@
  * under the License.
  */
 
-#include "Util.h"
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
+#include "Util.h"
+
 #if defined(HAVE_CLOCK_GETTIME)
 #include <time.h>
-#elif defined(HAVE_GETTIMEOFDAY)
+#elif defined(HAVE_SYS_TIME_H)
 #include <sys/time.h>
 #endif // defined(HAVE_CLOCK_GETTIME)
 

Modified: thrift/trunk/lib/cpp/src/concurrency/Util.h
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/concurrency/Util.h?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/concurrency/Util.h (original)
+++ thrift/trunk/lib/cpp/src/concurrency/Util.h Mon Sep  5 19:15:53 2011
@@ -24,7 +24,10 @@
 #include <stddef.h>
 #include <stdint.h>
 #include <time.h>
+
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
 
 namespace apache { namespace thrift { namespace concurrency {
 

Modified: thrift/trunk/lib/cpp/src/protocol/TProtocol.h
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/protocol/TProtocol.h?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/protocol/TProtocol.h (original)
+++ thrift/trunk/lib/cpp/src/protocol/TProtocol.h Mon Sep  5 19:15:53 2011
@@ -26,7 +26,9 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/static_assert.hpp>
 
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
 #include <sys/types.h>
 #include <string>
 #include <map>

Modified: thrift/trunk/lib/cpp/src/server/TNonblockingServer.cpp
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/server/TNonblockingServer.cpp?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/server/TNonblockingServer.cpp (original)
+++ thrift/trunk/lib/cpp/src/server/TNonblockingServer.cpp Mon Sep  5 19:15:53 2011
@@ -17,6 +17,10 @@
  * under the License.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "TNonblockingServer.h"
 #include <concurrency/Exception.h>
 #include <transport/TSocket.h>
@@ -30,6 +34,9 @@
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #include <netinet/tcp.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
 
@@ -37,7 +44,10 @@
 #include <netdb.h>
 #endif
 
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif
+
 #include <errno.h>
 #include <assert.h>
 

Modified: thrift/trunk/lib/cpp/src/server/TServer.cpp
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/server/TServer.cpp?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/server/TServer.cpp (original)
+++ thrift/trunk/lib/cpp/src/server/TServer.cpp Mon Sep  5 19:15:53 2011
@@ -17,9 +17,20 @@
  * under the License.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 namespace apache { namespace thrift { namespace server {
 

Modified: thrift/trunk/lib/cpp/src/transport/TFDTransport.h
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/transport/TFDTransport.h?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/transport/TFDTransport.h (original)
+++ thrift/trunk/lib/cpp/src/transport/TFDTransport.h Mon Sep  5 19:15:53 2011
@@ -21,7 +21,9 @@
 #define _THRIFT_TRANSPORT_TFDTRANSPORT_H_ 1
 
 #include <string>
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
 
 #include "TTransport.h"
 #include "TVirtualTransport.h"

Modified: thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp (original)
+++ thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp Mon Sep  5 19:15:53 2011
@@ -24,7 +24,9 @@
 #include "TFileTransport.h"
 #include "TTransportUtils.h"
 
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #else
@@ -32,14 +34,18 @@
 #endif
 #include <fcntl.h>
 #include <errno.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif
 #include <cstdlib>
 #include <cstring>
 #include <iostream>
+#ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
+#endif
 
 namespace apache { namespace thrift { namespace transport {
 

Modified: thrift/trunk/lib/cpp/src/transport/TSSLSocket.cpp
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/transport/TSSLSocket.cpp?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/transport/TSSLSocket.cpp (original)
+++ thrift/trunk/lib/cpp/src/transport/TSSLSocket.cpp Mon Sep  5 19:15:53 2011
@@ -17,11 +17,18 @@
  * under the License.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include <errno.h>
 #include <string>
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 #include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
 #include <boost/lexical_cast.hpp>
 #include <boost/shared_array.hpp>
 #include <openssl/err.h>

Modified: thrift/trunk/lib/cpp/src/transport/TServerSocket.cpp
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/transport/TServerSocket.cpp?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/transport/TServerSocket.cpp (original)
+++ thrift/trunk/lib/cpp/src/transport/TServerSocket.cpp Mon Sep  5 19:15:53 2011
@@ -17,18 +17,32 @@
  * under the License.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include <cstring>
 #include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_UN_H
 #include <sys/un.h>
+#endif
+#ifdef HAVE_SYS_POLL_H
 #include <sys/poll.h>
-#include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #include <netinet/tcp.h>
+#endif
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif
 #include <fcntl.h>
 #include <errno.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #include "TSocket.h"
 #include "TServerSocket.h"

Modified: thrift/trunk/lib/cpp/src/transport/TSimpleFileTransport.cpp
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/transport/TSimpleFileTransport.cpp?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/transport/TSimpleFileTransport.cpp (original)
+++ thrift/trunk/lib/cpp/src/transport/TSimpleFileTransport.cpp Mon Sep  5 19:15:53 2011
@@ -17,10 +17,15 @@
  * under the License.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include "TSimpleFileTransport.h"
 
 #include <sys/types.h>
+#ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
+#endif
 #include <fcntl.h>
 
 namespace apache { namespace thrift { namespace transport {

Modified: thrift/trunk/lib/cpp/src/transport/TSocket.cpp
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/transport/TSocket.cpp?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/transport/TSocket.cpp (original)
+++ thrift/trunk/lib/cpp/src/transport/TSocket.cpp Mon Sep  5 19:15:53 2011
@@ -17,17 +17,31 @@
  * under the License.
  */
 
+#ifdef HAVE_CONFIG_H
 #include <config.h>
+#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
+#ifdef HAVE_SYS_POLL_H
 #include <sys/poll.h>
+#endif
 #include <sys/types.h>
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #include <netinet/tcp.h>
+#endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <errno.h>
 #include <fcntl.h>
 

Modified: thrift/trunk/lib/cpp/src/transport/TSocket.h
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/transport/TSocket.h?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/transport/TSocket.h (original)
+++ thrift/trunk/lib/cpp/src/transport/TSocket.h Mon Sep  5 19:15:53 2011
@@ -21,8 +21,13 @@
 #define _THRIFT_TRANSPORT_TSOCKET_H_ 1
 
 #include <string>
+
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif
 
 #include "TTransport.h"
 #include "TVirtualTransport.h"

Modified: thrift/trunk/lib/cpp/test/Benchmark.cpp
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/test/Benchmark.cpp?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/test/Benchmark.cpp (original)
+++ thrift/trunk/lib/cpp/test/Benchmark.cpp Mon Sep  5 19:15:53 2011
@@ -17,13 +17,18 @@
  * under the License.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include <iostream>
 #include <cmath>
 #include "transport/TBufferTransports.h"
 #include "protocol/TBinaryProtocol.h"
 #include "gen-cpp/DebugProtoTest_types.h"
 #include <time.h>
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
 
 class Timer {
 public:

Modified: thrift/trunk/lib/cpp/test/TFileTransportTest.cpp
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/test/TFileTransportTest.cpp?rev=1165400&r1=1165399&r2=1165400&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/test/TFileTransportTest.cpp (original)
+++ thrift/trunk/lib/cpp/test/TFileTransportTest.cpp Mon Sep  5 19:15:53 2011
@@ -20,7 +20,12 @@
 #define _GNU_SOURCE // needed for getopt_long
 #endif
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
 #include <getopt.h>
 #include <boost/test/unit_test.hpp>