winsock + DSTRICT

Alexandre Julliard julliard at winehq.com
Mon Oct 28 16:50:43 CST 2002


Michael Stefaniuc <mstefani at redhat.de> writes:

> Well, i looked at the patch and it seems resonable. You are the winsock
> expert and if you feel confortable with it please submit it to
> wine-patches (Alexandre will complain if he dosn't like it ;). One
> request: i'm not sure if the compiler will optimize away the assert
> from __handle2socket on machines where sizeof(HANDLE) == sizeof(SOCKET).
> But if not could you please add something like
> if (sizeof(HANDLE) > sizeof(SOCKET)) {
>     assert(....
> }
> On i386 the size are equal and the assert not needed.

The assert is useless anyway. Even if the types have different sizes
you'll need to allocate a billion handles to trigger it. It's much
better to use a simple cast (without ULONG_PTR) so the compiler will
warn if the pointer and integer are different sizes.

-- 
Alexandre Julliard
julliard at winehq.com



More information about the wine-devel mailing list