From: patthoyts Date: Mon, 3 Mar 2003 22:24:33 +0000 (+0000) Subject: Fixed CONST compatability for Tcl 8.3/8.4. X-Git-Tag: tcludp-1_0_5~11 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=16cbc9adcabada402d262c35fba1a7fbd8bfb564;p=tcludp Fixed CONST compatability for Tcl 8.3/8.4. Fixed linux build by using autoconf defines for sys/ioctl.h --- diff --git a/ChangeLog b/ChangeLog index 19ea071..95e69a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-03-03 Pat Thoyts + + * generic/udp_tcl.c: Fix include list to use the autoconfig test + results. Fixes for CONST Tcl 8.3/8.4 compatability. + 2003-02-27 Pat Thoyts * generic/udp_tcl.c: Stop a crash when udp_conf -remote called diff --git a/generic/udp_tcl.c b/generic/udp_tcl.c index 5e2ca12..0358c36 100644 --- a/generic/udp_tcl.c +++ b/generic/udp_tcl.c @@ -25,13 +25,20 @@ #include #include #else -#ifdef LINUX +#if defined(HAVE_SYS_IOCTL_H) #include -#else +#elif defined(HAVE_SYS_FILIO_H) #include +#else +#error "Neither sys/ioctl.h nor sys/filio.h found. We need ioctl()" #endif #endif +/* Tcl 8.4 CONST support */ +#ifndef CONST84 +#define CONST84 +#endif + /* define some Win32isms for Unix */ #ifndef WIN32 #define SOCKET int @@ -50,13 +57,13 @@ FILE *dbg; static char errBuf[256]; -int udpOpen(ClientData , Tcl_Interp *, int , CONST char * []); -int udpConf(ClientData , Tcl_Interp *, int , CONST char * []); -int udpPeek(ClientData , Tcl_Interp *, int , CONST char * []); +int udpOpen(ClientData , Tcl_Interp *, int , CONST84 char * []); +int udpConf(ClientData , Tcl_Interp *, int , CONST84 char * []); +int udpPeek(ClientData , Tcl_Interp *, int , CONST84 char * []); static int udpGet(ClientData instanceData,int direction,ClientData *handlePtr); static void udpWatch(ClientData instanceData, int mask); -static int udpOutput(ClientData instanceData, CONST char *buf, int toWrite, int *errorCode); +static int udpOutput(ClientData instanceData, CONST84 char *buf, int toWrite, int *errorCode); static int udpInput(ClientData instanceData, char *buf, int bufSize, int *errorCode); static int udpClose(ClientData instanceData, Tcl_Interp *interp); static void udpTrace(const char *format, ...); @@ -162,7 +169,7 @@ udpGet(ClientData instanceData,int direction,ClientData *handlePtr) */ int udpPeek(ClientData clientData, Tcl_Interp *interp, - int argc, CONST char * argv[]) + int argc, CONST84 char * argv[]) { #ifndef WIN32 int buffer_size = 16; @@ -221,7 +228,7 @@ udpPeek(ClientData clientData, Tcl_Interp *interp, */ int udpConf(ClientData clientData, Tcl_Interp *interp, - int argc, CONST char * argv[]) + int argc, CONST84 char * argv[]) { Tcl_Channel chan; UdpState *statePtr; @@ -480,7 +487,7 @@ UDP_CheckProc(ClientData data, int flags) */ int udpOpen(ClientData clientData, Tcl_Interp *interp, - int argc, CONST char * argv[]) + int argc, CONST84 char * argv[]) { int sock; char channelName[20]; @@ -797,7 +804,7 @@ Udp_Init(Tcl_Interp *interp) * udpOutput-- */ static int -udpOutput(ClientData instanceData, CONST char *buf, int toWrite, int *errorCode) +udpOutput(ClientData instanceData, CONST84 char *buf, int toWrite, int *errorCode) { UdpState *statePtr = (UdpState *) instanceData; int written;