From bbe919853f24a2589b83e5d44e3ecf03f9a312e3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 12 Sep 2012 14:51:55 +0000 Subject: libbu++ version now uses libbu++ endian conversion macros and does not rely on winsock in windows. --- src/gatsstream.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/gatsstream.cpp b/src/gatsstream.cpp index 3e9b211..d5e3f82 100644 --- a/src/gatsstream.cpp +++ b/src/gatsstream.cpp @@ -1,12 +1,6 @@ #include "gats/gatsstream.h" #include "gats/object.h" -#ifdef WIN32 -#include -#else -#include -#endif - // #include #include // using namespace Bu; @@ -44,7 +38,7 @@ Gats::Object *Gats::GatsStream::readObject() int32_t iSize; qbRead.peek( &iSize, 4, 1 ); - iSize = ntohl( iSize ); + iSize = be32toh( iSize ); // sio << "Gats::GatsStream::readObject(): Header read, looking for " << iSize << "b, we have " << qbRead.getSize() << "b." << sio.nl; while( qbRead.getSize() < iSize ) { @@ -83,7 +77,7 @@ void Gats::GatsStream::writeObject( Gats::Object *pObject ) pObject->write( ns ); uint8_t uBuf = 1; - int32_t iSize = htonl( ns.tell()+5 ); + int32_t iSize = htobe32( ns.tell()+5 ); rStream.write( &uBuf, 1 ); rStream.write( &iSize, 4 ); pObject->write( rStream ); -- cgit v1.2.3