[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] evutil_closesocket() macro portability.



On Apr 14, 2010, at 7:39 AM, Nick Mathewson wrote:

> On Wed, Mar 24, 2010 at 6:21 AM, Sebastian Sjöberg
> <Sebastian.Sjoberg@xxxxxxxx> wrote:
>> Hi,
>> 
>> The EVUTIL_CLOSESOCKET() macro requires you to include unistd.h in your source for linux and I don't know what on windows. To ease portablilty wouldn't it be nice if we either turned the macro into a function or included the appropriate header where we define the macro?
>> 
>> I'd be happy to provide a patch for whatever behavior you would prefer.
> 
> Sounds plausible.  We might as well turn it into a function: an extra
> function call is going to be cheap in comparison with the system call.

Here's the patch. Not tested on windows though.

Thanks,
Sebastian Sjöberg

Attachment: evutil_closesocket.patch
Description: evutil_closesocket.patch

> 
> -- 
> Nick
> ***********************************************************************
> To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
> unsubscribe libevent-users    in the body.