[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: [PATCH] second try at fixing up socklen issues on Solaris
From:       Rob Napier <rnapier () employees ! org>
Date:       2001-04-04 23:52:03
[Download RAW message or body]

On Wed, Apr 04, 2001 at 11:52:20PM +0200, Oswald Buddenhagen wrote:
> if we don't want to install a system-dependend include file, we
> "simply" should not export any functions with the questionable
> parameter type - simply use int for this. inside the kde sources we
> can use socklen_t, as our configure detected it. if we have to receive
> lengths from users, we can put code like this in the exported
> functions:
> 
> public KSocket::SockFunc(int fd, struct sockaddr *addr, int *len)
> {
>    socklen_t ouraddr = (socklen_t) *len;
>    ::sockfunc(fd, addr, &ouraddr);
>    *len = (int) ouraddr;
> }
>
> that way we would basically hide this whole size_t-instead-of-int 
> braindamage the posix bozos created from our users (and ourselves).
> hmm ... this sounds too simple to be possible. i surely overlooked
> something. :)

Actually, this sounds perfect. I hadn't thought of forcing everyone
over to int externally instead of socklen_t. I won't get a chance to
look at this until at least tomorrow, so if somone else builds a
patch, that's fine. It's not complicated, just insidious....

Thanks,
Rob
 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic