From: gustafn <gne...@us...> - 2011-08-05 11:49:47
|
Update of /cvsroot/aolserver/aolserver/include In directory vz-cvs-4.sog:/tmp/cvs-serv1415/include Modified Files: ns.h Log Message: Patches mostly from Maurizio Martignano - changed types of file descriptors for socket from "int" to "SOCKET" - some more _WIN32 cleanups - defined macro INT2PTR() like in tclInt.h for uniform conversion from "int" to pointers - minor cleanups for unix using INT2PTR (more similar occurences still to do) Index: ns.h =================================================================== RCS file: /cvsroot/aolserver/aolserver/include/ns.h,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** ns.h 9 Jul 2011 10:06:46 -0000 1.91 --- ns.h 5 Aug 2011 11:49:44 -0000 1.92 *************** *** 161,164 **** --- 161,174 ---- typedef ns_int64 INT64; + #if !defined(INT2PTR) && !defined(PTR2INT) + # if defined(HAVE_INTPTR_T) || defined(intptr_t) + # define INT2PTR(p) ((void *)(intptr_t)(p)) + # define PTR2INT(p) ((int)(intptr_t)(p)) + # else + # define INT2PTR(p) ((void *)(p)) + # define PTR2INT(p) ((int)(p)) + # endif + #endif + /* * The following flags define how Ns_Set's *************** *** 220,224 **** #define O_TEXT 0 #define O_BINARY 0 ! #define SOCKET int #define INVALID_SOCKET (-1) #define SOCKET_ERROR (-1) --- 230,234 ---- #define O_TEXT 0 #define O_BINARY 0 ! #define SOCKET int #define INVALID_SOCKET (-1) #define SOCKET_ERROR (-1) *************** *** 671,675 **** NS_EXTERN char *Ns_ConnHost(Ns_Conn *conn); NS_EXTERN int Ns_ConnPort(Ns_Conn *conn); ! NS_EXTERN int Ns_ConnSock(Ns_Conn *conn); NS_EXTERN char *Ns_ConnDriverName(Ns_Conn *conn); NS_EXTERN void *Ns_ConnDriverContext(Ns_Conn *conn); --- 681,685 ---- NS_EXTERN char *Ns_ConnHost(Ns_Conn *conn); NS_EXTERN int Ns_ConnPort(Ns_Conn *conn); ! NS_EXTERN SOCKET Ns_ConnSock(Ns_Conn *conn); NS_EXTERN char *Ns_ConnDriverName(Ns_Conn *conn); NS_EXTERN void *Ns_ConnDriverContext(Ns_Conn *conn); |