[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:       Thiago Macieira <thiago.macieira () poli ! usp ! br>
Date:       2001-04-05 1:38:09
[Download RAW message or body]

Rob Napier wrote:

> 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....

Which is exactly the reason I created the ksocklen_t type in the first 
place. Actually, I didn't want to include sys/socket.h in the code just 
to have socklen_t defined, so I created a type that would be exactly that.

Maybe the problem was making it a typedef instead of #define.

However, after so many problems and all that, I don't remember any more 
what exactly the problems were.

So, my recommendation is:
- use a general type for all KDE exported functions, from 
KExtendedSocket, KSocket, K*SocketAddress and KSocks. Should be "int", 
"unsigned" or a #define'd ksocklen_t

- make sure all our calls to the system functions cast that to 
"ksize_t", which is #define'd to be the third parameter of getsockname()

And "ksize_t" is a misnomer. It's the one that should be "ksocklen_t", 
but we can't change that anymore. Or it should be "size_t", not the 
third parameter of getsockname().

I don't think typedef is a good alternative anymore because some 
compilers use the new type's name in the mangling of the C++ function, 
while others (like gcc) will use the primitive type.

-- 
   Thiago Macieira - UFOT Registry number: 1001
  thiagom@mail.com talha@geocities.com
    ICQ UIN: 1967141  PGP: 0x8F2978D5 and 0xEA9037A5
      Registered Linux user #65028

13/392. You broke your little ships. -- Lily Sloane, Star Trek: First 
Contact

 
>> 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