libjingle gcc 4.5.1 patches
时间:2010-08-25 来源:tbfly
为了编译,顺手改了一下。对应于google code的svn版本。 Index: talk/p2p/base/pseudotcp.cc =================================================================== --- talk/p2p/base/pseudotcp.cc (revision 27) +++ talk/p2p/base/pseudotcp.cc (working copy) @@ -25,6 +25,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <stdlib.h> #include "talk/base/basicdefs.h" #include "talk/base/basictypes.h" #include "talk/base/byteorder.h" Index: talk/p2p/base/relayserver_main.cc =================================================================== --- talk/p2p/base/relayserver_main.cc (revision 27) +++ talk/p2p/base/relayserver_main.cc (working copy) @@ -53,13 +53,13 @@ talk_base::AsyncUDPSocket* int_socket = talk_base::CreateAsyncUDPSocket(pthMain->socketserver()); if (int_socket->Bind(int_addr) < 0) { - std::cerr << "bind: " << std::strerror(errno) << std::endl; + std::cerr << "bind: " << strerror(errno) << std::endl; return 1; } talk_base::AsyncUDPSocket* ext_socket = talk_base::CreateAsyncUDPSocket(pthMain->socketserver()); if (ext_socket->Bind(ext_addr) < 0) { - std::cerr << "bind: " << std::strerror(errno) << std::endl; + std::cerr << "bind: " << strerror(errno) << std::endl; return 1; } Index: talk/p2p/base/stunserver_unittest.cc =================================================================== --- talk/p2p/base/stunserver_unittest.cc (revision 27) +++ talk/p2p/base/stunserver_unittest.cc (working copy) @@ -6,6 +6,7 @@ #include <cstring> #include <iostream> #include <cassert> +#include <stdio.h> using namespace cricket; Index: talk/p2p/base/stunserver.cc =================================================================== --- talk/p2p/base/stunserver.cc (revision 27) +++ talk/p2p/base/stunserver.cc (working copy) @@ -28,6 +28,7 @@ #include "talk/base/bytebuffer.h" #include "talk/p2p/base/stunserver.h" #include <iostream> +#include <string.h> #ifdef POSIX extern "C" { @@ -154,7 +155,7 @@ // TODO: Allow response addr attribute if sent from another stun server. if (socket_->SendTo(buf.Data(), buf.Length(), addr) < 0) - std::cerr << "sendto: " << std::strerror(errno) << std::endl; + std::cerr << "sendto: " << strerror(errno) << std::endl; } } // namespace cricket Index: talk/p2p/base/session_unittest.cc =================================================================== --- talk/p2p/base/session_unittest.cc (revision 27) +++ talk/p2p/base/session_unittest.cc (working copy) @@ -3,6 +3,8 @@ #include <deque> #include <map> +#include <stdio.h> +#include <stdlib.h> #include "talk/base/common.h" #include "talk/base/logging.h" #include "talk/base/host.h" @@ -341,7 +343,7 @@ ASSERT(size <= sizeof(last_data)); data_count += 1; last_size = size; - std::memcpy(last_data, buf, size); + memcpy(last_data, buf, size); } void Send(const char* data, size_t size) { @@ -449,10 +451,10 @@ ASSERT(chanhandler2a->last_size == strlen(dat1a)); ASSERT(chanhandler2b->last_size == strlen(dat1b)); - ASSERT(std::memcmp(chanhandler1a->last_data, dat2a, strlen(dat2a)) == 0); - ASSERT(std::memcmp(chanhandler1b->last_data, dat2b, strlen(dat2b)) == 0); - ASSERT(std::memcmp(chanhandler2a->last_data, dat1a, strlen(dat1a)) == 0); - ASSERT(std::memcmp(chanhandler2b->last_data, dat1b, strlen(dat1b)) == 0); + ASSERT(memcmp(chanhandler1a->last_data, dat2a, strlen(dat2a)) == 0); + ASSERT(memcmp(chanhandler1b->last_data, dat2b, strlen(dat2b)) == 0); + ASSERT(memcmp(chanhandler2a->last_data, dat1a, strlen(dat1a)) == 0); + ASSERT(memcmp(chanhandler2b->last_data, dat1b, strlen(dat1b)) == 0); } } Index: talk/p2p/base/stun.cc =================================================================== --- talk/p2p/base/stun.cc (revision 27) +++ talk/p2p/base/stun.cc (working copy) @@ -29,6 +29,7 @@ #include "talk/p2p/base/stun.h" #include <iostream> #include <cassert> +#include <string.h> #if defined(_MSC_VER) && _MSC_VER < 1300 namespace std { @@ -386,7 +387,8 @@ void StunByteStringAttribute::CopyBytes(const void* bytes, uint16 length) { char* new_bytes = new char[length]; - std::memcpy(new_bytes, bytes, length); + //std::memcpy(new_bytes, bytes, length); + memcpy(new_bytes, bytes, length); SetBytes(new_bytes, length); } Index: talk/p2p/base/sessionmanager.h =================================================================== --- talk/p2p/base/sessionmanager.h (revision 27) +++ talk/p2p/base/sessionmanager.h (working copy) @@ -156,7 +156,7 @@ // Creates and returns an error message from the given components. The // caller is responsible for deleting this. - buzz::XmlElement* SessionManager::CreateErrorMessage( + buzz::XmlElement* CreateErrorMessage( const buzz::XmlElement* stanza, const buzz::QName& name, const std::string& type, Index: talk/p2p/base/relayport.cc =================================================================== --- talk/p2p/base/relayport.cc (revision 27) +++ talk/p2p/base/relayport.cc (working copy) @@ -33,6 +33,7 @@ #include "talk/base/helpers.h" #include "talk/p2p/base/relayport.h" #include <iostream> +#include <string.h> #include <cassert> #ifdef OSX #include <errno.h> @@ -215,7 +216,8 @@ if (size < 24 + magic_cookie_.size()) { return false; } else { - return 0 == std::memcmp(data + 24, + //return 0 == std::memcmp(data + 24, + return 0 == memcmp(data + 24, magic_cookie_.c_str(), magic_cookie_.size()); } @@ -367,7 +369,7 @@ socket_->SignalReadPacket.connect(this, &RelayEntry::OnReadPacket); if (socket_->Bind(local_addr_) < 0) - LOG(INFO) << "bind: " << std::strerror(socket_->GetError()); + LOG(INFO) << "bind: " << strerror(socket_->GetError()); for (unsigned i = 0; i < port_->options().size(); ++i) socket_->SetOption(port_->options()[i].first, port_->options()[i].second); @@ -559,7 +561,7 @@ } int sent = socket_->SendTo(data, size, ra->address); if (sent <= 0) { - LOG(LS_VERBOSE) << "sendto: " << std::strerror(socket_->GetError()); + LOG(LS_VERBOSE) << "sendto: " << strerror(socket_->GetError()); assert(sent < 0); } return sent; Index: talk/p2p/base/port_unittest.cc =================================================================== --- talk/p2p/base/port_unittest.cc (revision 27) +++ talk/p2p/base/port_unittest.cc (working copy) @@ -11,6 +11,7 @@ #include "talk/p2p/base/stunport.h" #include "talk/p2p/base/stunserver.h" #include <iostream> +#include <stdio.h> using namespace cricket; Index: talk/p2p/base/stunserver_main.cc =================================================================== --- talk/p2p/base/stunserver_main.cc (revision 27) +++ talk/p2p/base/stunserver_main.cc (working copy) @@ -29,6 +29,7 @@ #include "talk/base/thread.h" #include "talk/p2p/base/stunserver.h" #include <iostream> +#include <string.h> #ifdef POSIX extern "C" { @@ -50,7 +51,7 @@ talk_base::AsyncUDPSocket* server_socket = talk_base::CreateAsyncUDPSocket(pthMain->socketserver()); if (server_socket->Bind(server_addr) < 0) { - std::cerr << "bind: " << std::strerror(errno) << std::endl; + std::cerr << "bind: " << strerror(errno) << std::endl; return 1; } Index: talk/p2p/base/port.cc =================================================================== --- talk/p2p/base/port.cc (revision 27) +++ talk/p2p/base/port.cc (working copy) @@ -34,6 +34,7 @@ #include <algorithm> #include <iostream> #include <vector> +#include <string.h> #include "talk/base/asyncudpsocket.h" #include "talk/base/asynctcpsocket.h" @@ -284,7 +285,8 @@ if (stun_msg->type() == STUN_BINDING_REQUEST) { if ((remote_frag_len < 0) - || (std::memcmp(username_attr->bytes(), + //|| (std::memcmp(username_attr->bytes(), + || (memcmp(username_attr->bytes(), username_frag_.c_str(), username_frag_.size()) != 0)) { LOG_J(LS_ERROR, this) << "Received STUN request with bad username"; SendBindingErrorResponse(stun_msg.get(), addr, STUN_ERROR_BAD_REQUEST, @@ -297,7 +299,8 @@ } else if ((stun_msg->type() == STUN_BINDING_RESPONSE) || (stun_msg->type() == STUN_BINDING_ERROR_RESPONSE)) { if ((remote_frag_len < 0) - || (std::memcmp(username_attr->bytes() + remote_frag_len, + //|| (std::memcmp(username_attr->bytes() + remote_frag_len, + || (memcmp(username_attr->bytes() + remote_frag_len, username_frag_.c_str(), username_frag_.size()) != 0)) { LOG_J(LS_ERROR, this) << "Received STUN response with bad username"; // Do not send error response to a response @@ -796,7 +799,8 @@ if (valid) { std::string username_fragment = port_->username_fragment(); int offset = (int)(username_attr->length() - username_fragment.size()); - if (std::memcmp(username_attr->bytes() + offset, + //if (std::memcmp(username_attr->bytes() + offset, + if (memcmp(username_attr->bytes() + offset, username_fragment.c_str(), username_fragment.size()) != 0) { LOG_J(LS_ERROR, this) << "Received STUN response with bad username"; valid = false; Index: talk/xmpp/xmppclient.h =================================================================== --- talk/xmpp/xmppclient.h (revision 27) +++ talk/xmpp/xmppclient.h (working copy) @@ -138,7 +138,7 @@ } } - std::string XmppClient::GetStateName(int state) const { + std::string GetStateName(int state) const { switch (state) { case STATE_PRE_XMPP_LOGIN: return "PRE_XMPP_LOGIN"; case STATE_START_XMPP_LOGIN: return "START_XMPP_LOGIN"; Index: talk/base/testclient.cc =================================================================== --- talk/base/testclient.cc (revision 27) +++ talk/base/testclient.cc (working copy) @@ -27,6 +27,7 @@ #include <iostream> #include <cassert> +#include <stdlib.h> #ifdef POSIX extern "C" { @@ -63,7 +64,8 @@ void TestClient::Send(const char* buf, size_t size) { int result = socket_->Send(buf, size); if (result < 0) { - std::cerr << "send: " << std::strerror(errno) << std::endl; + //std::cerr << "send: " << std::strerror(errno) << std::endl; + std::cerr << "send: " << strerror(errno) << std::endl; exit(1); } } @@ -72,7 +74,8 @@ const char* buf, size_t size, const SocketAddress& dest) { int result = socket_->SendTo(buf, size, dest); if (result < 0) { - std::cerr << "sendto: " << std::strerror(errno) << std::endl; + //std::cerr << "sendto: " << std::strerror(errno) << std::endl; + std::cerr << "sendto: " << strerror(errno) << std::endl; exit(1); } } @@ -132,7 +135,8 @@ Packet* packet = NextPacket(); assert(packet); assert(packet->size == size); - assert(std::memcmp(packet->buf, buf, size) == 0); + //assert(std::memcmp(packet->buf, buf, size) == 0); + assert(memcmp(packet->buf, buf, size) == 0); if (addr) *addr = packet->addr; } Index: talk/base/stringencode.cc =================================================================== --- talk/base/stringencode.cc (revision 27) +++ talk/base/stringencode.cc (working copy) @@ -33,6 +33,8 @@ #define _alloca alloca #endif // POSIX +#include <stdlib.h> + #include "talk/base/basictypes.h" #include "talk/base/common.h" #include "talk/base/stringencode.h" Index: talk/base/urlencode.cc =================================================================== --- talk/base/urlencode.cc (revision 27) +++ talk/base/urlencode.cc (working copy) @@ -1,4 +1,6 @@ #include "talk/base/urlencode.h" +#include <string.h> +#include <stdlib.h> static int HexPairValue(const char * code) { int value = 0; Index: talk/base/natsocketfactory.cc =================================================================== --- talk/base/natsocketfactory.cc (revision 27) +++ talk/base/natsocketfactory.cc (working copy) @@ -27,6 +27,7 @@ #include <iostream> #include <cassert> +#include <string.h> #include "talk/base/natsocketfactory.h" namespace talk_base { @@ -187,7 +188,8 @@ const SocketAddress& remote_addr) { assert(buf_size == data_size + remote_addr.Size_()); remote_addr.Write_(buf, (int)buf_size); - std::memcpy(buf + remote_addr.Size_(), data, data_size); + //std::memcpy(buf + remote_addr.Size_(), data, data_size); + memcpy(buf + remote_addr.Size_(), data, data_size); } // Decodes the given packet from the NAT server into the actual remote @@ -198,7 +200,8 @@ assert(data_size <= *buf_size + remote_addr->Size_()); remote_addr->Read_(data, (int)data_size); *buf_size = data_size - remote_addr->Size_(); - std::memcpy(buf, data + remote_addr->Size_(), *buf_size); + //std::memcpy(buf, data + remote_addr->Size_(), *buf_size); + memcpy(buf, data + remote_addr->Size_(), *buf_size); } bool async_; Index: talk/base/base64.h =================================================================== --- talk/base/base64.h (revision 27) +++ talk/base/base64.h (working copy) @@ -23,8 +23,8 @@ static std::string decode(const std::string & data); static std::string encodeFromArray(const char * data, size_t len); private: - static const std::string Base64::Base64Table; - static const std::string::size_type Base64::DecodeTable[]; + static const std::string Base64Table; + static const std::string::size_type DecodeTable[]; }; } // namespace talk_base Index: talk/base/natserver.cc =================================================================== --- talk/base/natserver.cc (revision 27) +++ talk/base/natserver.cc (working copy) @@ -161,7 +161,8 @@ char* real_buf = new char[real_size]; remote_addr.Write_(real_buf, real_size); - std::memcpy(real_buf + remote_addr.Size_(), buf, size); + //std::memcpy(real_buf + remote_addr.Size_(), buf, size); + memcpy(real_buf + remote_addr.Size_(), buf, size); server_socket_->SendTo(real_buf, real_size, iter->second->route.source()); Index: talk/base/openssladapter.cc =================================================================== --- talk/base/openssladapter.cc (revision 27) +++ talk/base/openssladapter.cc (working copy) @@ -641,7 +641,7 @@ int extension_nid = OBJ_obj2nid(X509_EXTENSION_get_object(extension)); if (extension_nid == NID_subject_alt_name) { - X509V3_EXT_METHOD* meth = X509V3_EXT_get(extension); + X509V3_EXT_METHOD* meth = (X509V3_EXT_METHOD*)X509V3_EXT_get(extension); if (!meth) break; Index: talk/base/streamutils.cc =================================================================== --- talk/base/streamutils.cc (revision 27) +++ talk/base/streamutils.cc (working copy) @@ -28,6 +28,7 @@ #include "talk/base/common.h" #include "talk/base/streamutils.h" +#include <string.h> /////////////////////////////////////////////////////////////////////////////// // TODO: Extend so that one side can close, and other side can send Index: talk/base/logging.cc =================================================================== --- talk/base/logging.cc (revision 27) +++ talk/base/logging.cc (working copy) @@ -31,6 +31,8 @@ #undef ERROR // wingdi.h #endif +#include <stdio.h> +#include <string.h> #include <iostream> #include <iomanip> Index: talk/base/stringutils.h =================================================================== --- talk/base/stringutils.h (revision 27) +++ talk/base/stringutils.h (working copy) @@ -36,6 +36,7 @@ #endif // WIN32 #include <string> +#include <string.h> /////////////////////////////////////////////////////////////////////////////// // Generic string/memory utilities @@ -269,7 +270,8 @@ template<> struct Traits<char> { typedef std::string string; - inline static const char* Traits<char>::empty_str() { return ""; } + //inline static const char* Traits<char>::empty_str() { return ""; } + inline static const char* empty_str() { return ""; } }; /////////////////////////////////////////////////////////////////////////////// Index: talk/base/network.cc =================================================================== --- talk/base/network.cc (revision 27) +++ talk/base/network.cc (working copy) @@ -31,6 +31,7 @@ #include <cmath> #include <sstream> +#include <string.h> #ifdef POSIX extern "C" { #include <sys/socket.h> Index: talk/base/messagequeue.h =================================================================== --- talk/base/messagequeue.h (revision 27) +++ talk/base/messagequeue.h (working copy) @@ -31,6 +31,7 @@ #include <vector> #include <queue> #include <algorithm> +#include <string.h> #include "talk/base/basictypes.h" #include "talk/base/criticalsection.h" #include "talk/base/socketserver.h" Index: talk/base/stream.cc =================================================================== --- talk/base/stream.cc (revision 27) +++ talk/base/stream.cc (working copy) @@ -29,6 +29,8 @@ #include <sys/stat.h> #include <errno.h> #include <string> +#include <string.h> +#include <stdio.h> #include "talk/base/basictypes.h" #include "talk/base/common.h" #include "talk/base/stream.h" Index: talk/base/bytebuffer.cc =================================================================== --- talk/base/bytebuffer.cc (revision 27) +++ talk/base/bytebuffer.cc (working copy) @@ -28,6 +28,7 @@ #include <algorithm> #include <cassert> +#include <string.h> #include "talk/base/basictypes.h" #include "talk/base/bytebuffer.h" #include "talk/base/byteorder.h" Index: talk/base/asynctcpsocket.cc =================================================================== --- talk/base/asynctcpsocket.cc (revision 27) +++ talk/base/asynctcpsocket.cc (working copy) @@ -29,6 +29,7 @@ #pragma warning(disable:4786) #endif +#include <string.h> #include "talk/base/asynctcpsocket.h" #include "talk/base/byteorder.h" #include "talk/base/common.h" @@ -169,7 +170,8 @@ if (len < 0) { // TODO: Do something better like forwarding the error to the user. if (!socket_->IsBlocking()) { - LOG(LS_ERROR) << "recvfrom: " << errno << " " << std::strerror(errno); + //LOG(LS_ERROR) << "recvfrom: " << errno << " " << std::strerror(errno); + LOG(LS_ERROR) << "recvfrom: " << errno << " " << strerror(errno); } return; } Index: talk/base/socketadapters.cc =================================================================== --- talk/base/socketadapters.cc (revision 27) +++ talk/base/socketadapters.cc (working copy) @@ -123,7 +123,8 @@ int len = socket_->Recv(buffer_ + data_len_, buffer_size_ - data_len_); if (len < 0) { // TODO: Do something better like forwarding the error to the user. - LOG(INFO) << "Recv: " << errno << " " << std::strerror(errno); + //LOG(INFO) << "Recv: " << errno << " " << std::strerror(errno); + LOG(INFO) << "Recv: " << errno << " " << strerror(errno); return; } Index: talk/base/host.cc =================================================================== --- talk/base/host.cc (revision 27) +++ talk/base/host.cc (working copy) @@ -36,6 +36,8 @@ } #endif // POSIX +#include <stdlib.h> + #include "talk/base/host.h" #include "talk/base/logging.h" #include "talk/base/network.h" @@ -54,7 +56,8 @@ void FatalError(const std::string& name, int err) { PLOG(LERROR, err) << name; - std::exit(1); + //std::exit(1); + exit(1); } } Index: talk/base/cryptstring.h =================================================================== --- talk/base/cryptstring.h (revision 27) +++ talk/base/cryptstring.h (working copy) @@ -29,6 +29,7 @@ #define _TALK_BASE_CRYPTSTRING_H_ #include <string> +#include <string.h> #include "talk/base/linked_ptr.h" #include "talk/base/scoped_ptr.h" Index: talk/examples/login/login_main.cc =================================================================== --- talk/examples/login/login_main.cc (revision 27) +++ talk/examples/login/login_main.cc (working copy) @@ -29,6 +29,7 @@ #include "talk/xmpp/xmppclientsettings.h" #include "talk/examples/login/xmppthread.h" #include <iostream> +#include <stdio.h> int main(int argc, char **argv) { printf("Auth Cookie: ");
相关阅读 更多 +