From d7aacaac32039ed267c4c7f1b91481fcf50f5ceb Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 16 Jun 2009 18:51:33 +0000 Subject: [PATCH] - don't include config.h from network.h (Gabor Gombas) svn path=/trunk/boinc/; revision=18428 --- checkin_notes | 10 ++++++++++ client/gui_rpc_server.cpp | 6 +++--- lib/network.cpp | 2 +- lib/network.h | 9 --------- m4/boinc_getsockopt.m4 | 5 +++++ 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/checkin_notes b/checkin_notes index 358e8e2c99..44425338b9 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5700,3 +5700,13 @@ David 16 June 2009 client/ client_types.cpp,h + +David 16 June 2009 + - don't include config.h from network.h (Gabor Gombas) + + client/ + gui_rpc_server.cpp + m4/ + boinc_getsockopt.m4 + lib/ + network.cpp,h diff --git a/client/gui_rpc_server.cpp b/client/gui_rpc_server.cpp index 6b2a4894c3..7673b22f3c 100644 --- a/client/gui_rpc_server.cpp +++ b/client/gui_rpc_server.cpp @@ -250,7 +250,7 @@ int GUI_RPC_CONN_SET::init(bool last_time) { int one = 1; setsockopt(lsock, SOL_SOCKET, SO_REUSEADDR, (char*)&one, 4); - retval = bind(lsock, (const sockaddr*)(&addr), (boinc_socklen_t)sizeof(addr)); + retval = bind(lsock, (const sockaddr*)(&addr), (socklen_t)sizeof(addr)); if (retval) { #ifndef _WIN32 retval = errno; // Display the real error code @@ -367,8 +367,8 @@ void GUI_RPC_CONN_SET::got_select(FDSET_GROUP& fg) { return; } - boinc_socklen_t addr_len = sizeof(addr); - sock = accept(lsock, (struct sockaddr*)&addr, (boinc_socklen_t*)&addr_len); + socklen_t addr_len = sizeof(addr); + sock = accept(lsock, (struct sockaddr*)&addr, (socklen_t*)&addr_len); if (sock == -1) { return; } diff --git a/lib/network.cpp b/lib/network.cpp index 688350a5c8..5fdc77c0b2 100644 --- a/lib/network.cpp +++ b/lib/network.cpp @@ -174,7 +174,7 @@ void boinc_close_socket(int sock) { } int get_socket_error(int fd) { - boinc_socklen_t intsize = sizeof(int); + socklen_t intsize = sizeof(int); int n; #if defined(_WIN32) && defined(USE_WINSOCK) getsockopt(fd, SOL_SOCKET, SO_ERROR, (char *)&n, &intsize); diff --git a/lib/network.h b/lib/network.h index 3d3ebb6bc8..94038b0de6 100644 --- a/lib/network.h +++ b/lib/network.h @@ -22,7 +22,6 @@ #ifndef _WIN32 #include #include -#include "config.h" #else #include "boinc_win.h" #endif @@ -49,14 +48,6 @@ extern int get_socket_error(int fd); extern const char* socket_error_str(); extern void reset_dns(); -#if defined(_WIN32) && defined(USE_WINSOCK) -typedef int boinc_socklen_t; -#define SHUT_WR SD_SEND -#else -typedef BOINC_SOCKLEN_T boinc_socklen_t; -#endif - - #ifndef NETWORK_ALIVE_LAN #define NETWORK_ALIVE_LAN 0x00000001 #endif diff --git a/m4/boinc_getsockopt.m4 b/m4/boinc_getsockopt.m4 index 7f5fdfd971..f64d0f0d7a 100644 --- a/m4/boinc_getsockopt.m4 +++ b/m4/boinc_getsockopt.m4 @@ -71,5 +71,10 @@ CFLAGS="${B_SV_CFLAGS}" CPPFLAGS="${B_SV_CPPFLAGS}" AC_DEFINE_UNQUOTED([BOINC_SOCKLEN_T],[${boinc_cv_getsockopt_type}],[Define to the type pointed to by the 5th parameter of getsockopt]) AC_LANG_POP(C) +AH_BOTTOM([ +#ifndef HAVE_SOCKLEN_T +typedef BOINC_SOCKLEN_T socklen_t; +#endif +]) ])