@@ -36,17 +36,10 @@ # else # define CONST86 # endif #endif -/* - * Backwards compatibility for size type change - */ -#if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7 - #define TCL_SIZE_MODIFIER "" -#endif - #include #include #include #include @@ -171,11 +164,11 @@ BIO *p_bio; /* Parent BIO (that is layered on Tcl_Channel) */ unsigned char *protos; /* List of supported protocols in protocol format */ unsigned int protos_len; /* Length of protos */ - char *err; + const char *err; } State; #ifdef USE_TCL_STUBS #ifndef Tcl_StackChannel #error "Unable to compile on this version of Tcl" @@ -185,10 +178,29 @@ #if TCL_MAJOR_VERSION < 9 typedef char tls_free_type; #else typedef void tls_free_type; #endif + +#ifndef JOIN +# define JOIN(a,b) JOIN1(a,b) +# define JOIN1(a,b) a##b +#endif + +#ifndef TCL_UNUSED +# if defined(__cplusplus) +# define TCL_UNUSED(T) T +# elif defined(__GNUC__) && (__GNUC__ > 2) +# define TCL_UNUSED(T) T JOIN(dummy, __LINE__) __attribute__((unused)) +# else +# define TCL_UNUSED(T) T JOIN(dummy, __LINE__) +# endif +#endif + +#if (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7) && !defined(TCL_SIZE_MODIFIER) +# define TCL_SIZE_MODIFIER "" +#endif /* * Forward declarations */ const Tcl_ChannelType *Tls_ChannelType(void);