< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate] Socket portability issue


Thanks.  I changed the definitions of INVALID_SOCKET and SOCKET_ERROR
to #defines for non WIN32 so now they should be defined consistently
across platforms.

Scott

On Thu, Dec 11, 2008 at 6:03 AM, Gregor Jasny <jasny@xxxxxxxxxx> wrote:
> Hi,
>
> I've stumbled across a Win32/Unix portability issue. In my source files I
> don't declare 'using namespace resip'. Because of the following code in
> Socket.hxx
>
> namespace resip {
>
> #ifndef WIN32
> typedef int Socket;
> static const Socket INVALID_SOCKET = -1;
> static const int SOCKET_ERROR = -1;
> inline int getErrno() { return errno; }
> #else
> typedef SOCKET Socket;
> inline int getErrno() { return WSAGetLastError(); }
> #endif
>
> }
>
> this results in SOCKET_ERROR living in the :: scope on Windows (there it is
> a plain define) and in the resip:: scope on non-Windows. I would suggest to
> either convert INVALID_SOCKET and SOCKET_ERROR to defines, too, or put a
> using resip::INVALID_SOCKET; using resip::SOCKET_ERROR; at the end of
> Socket.hxx.
>
> Thanks,
> Gregor
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel@xxxxxxxxxxxxxxx
> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
>