[Interest] What is QT_SOCKET_CONNECT?

Thiago Macieira thiago at kde.org
Thu Feb 9 11:05:56 CET 2012


On Thursday, 9 de February de 2012 17.45.01, gemfield wrote:
> Hi,
> 
> I found many codeing style like below in Qt source:
> 
> static inline int qt_safe_connect(int sockfd, const struct sockaddr *addr,
> QT_SOCKLEN_T addrlen)
 {
>     register int ret;
>     EINTR_LOOP(ret, QT_SOCKET_CONNECT(sockfd, const_cast<struct sockaddr
> *>(addr), addrlen));
 return ret;
> }
> #undef QT_SOCKET_CONNECT
> #define QT_SOCKET_CONNECT qt_safe_connect
> 
> What does QT_SOCKET_CONNECT macro really mean?
> 
> I think it shoule be a Linux API-connect,but I can't find it.

You did not search well enough.

mkspecs/common/posix/qplatformdefs.h:#define QT_SOCKET_CONNECT       ::connect
mkspecs/solaris-cc-64/qplatformdefs.h:#undef QT_SOCKET_CONNECT
mkspecs/solaris-cc-64/qplatformdefs.h:#define QT_SOCKET_CONNECT       
qt_socket_connect
mkspecs/solaris-cc/qplatformdefs.h:#undef QT_SOCKET_CONNECT
mkspecs/solaris-cc/qplatformdefs.h:#define QT_SOCKET_CONNECT       
qt_socket_connect
mkspecs/solaris-g++-64/qplatformdefs.h:#undef QT_SOCKET_CONNECT
mkspecs/solaris-g++-64/qplatformdefs.h:#define QT_SOCKET_CONNECT       
qt_socket_connect
mkspecs/solaris-g++/qplatformdefs.h:#undef QT_SOCKET_CONNECT
mkspecs/solaris-g++/qplatformdefs.h:#define QT_SOCKET_CONNECT       
qt_socket_connect
mkspecs/unsupported/integrity-ghs/qplatformdefs.h:#define QT_SOCKET_CONNECT     
::connect
mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h:#undef 
QT_SOCKET_CONNECT
mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h:#define 
QT_SOCKET_CONNECT(sd, to, tolen) \


-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120209/5ffb65e1/attachment.sig>


More information about the Interest mailing list