diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclDecls.h | 17 | ||||
-rw-r--r-- | generic/tclObj.c | 1 | ||||
-rw-r--r-- | generic/tclPlatDecls.h | 8 | ||||
-rw-r--r-- | generic/tclTestObj.c | 6 | ||||
-rw-r--r-- | generic/tclTomMathDecls.h | 6 |
5 files changed, 29 insertions, 9 deletions
diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 9279e2d..aee81e7 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -4144,12 +4144,20 @@ extern const TclStubs *tclStubsPtr; # endif #endif +#undef Tcl_GetString +#undef Tcl_GetUnicode +#define Tcl_GetString(objPtr) \ + Tcl_GetStringFromObj(objPtr, (int *)NULL) +#define Tcl_GetUnicode(objPtr) \ + Tcl_GetUnicodeFromObj(objPtr, (int *)NULL) +#ifdef TCL_NO_DEPRECATED #undef Tcl_GetStringFromObj #undef Tcl_GetBytesFromObj #undef Tcl_GetUnicodeFromObj #undef Tcl_GetByteArrayFromObj -#undef Tcl_GetUnicode +#endif #if defined(USE_TCL_STUBS) +#ifdef TCL_NO_DEPRECATED #define Tcl_GetStringFromObj(objPtr, sizePtr) \ (sizeof(*sizePtr) <= sizeof(int) ? tclStubsPtr->tcl_GetStringFromObj(objPtr, (int *)sizePtr) : tclStubsPtr->tclGetStringFromObj(objPtr, (size_t *)sizePtr)) #define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) \ @@ -4158,9 +4166,9 @@ extern const TclStubs *tclStubsPtr; (sizeof(*sizePtr) <= sizeof(int) ? tclStubsPtr->tcl_GetByteArrayFromObj(objPtr, (int *)sizePtr) : tclStubsPtr->tclGetByteArrayFromObj(objPtr, (size_t *)sizePtr)) #define Tcl_GetUnicodeFromObj(objPtr, sizePtr) \ (sizeof(*sizePtr) <= sizeof(int) ? tclStubsPtr->tcl_GetUnicodeFromObj(objPtr, (int *)sizePtr) : tclStubsPtr->tclGetUnicodeFromObj(objPtr, (size_t *)sizePtr)) -#define Tcl_GetUnicode(objPtr) \ - tclStubsPtr->tcl_GetUnicodeFromObj(objPtr, NULL) +#endif #else +#ifdef TCL_NO_DEPRECATED #define Tcl_GetStringFromObj(objPtr, sizePtr) \ (sizeof(*sizePtr) <= sizeof(int) ? (Tcl_GetStringFromObj)(objPtr, (int *)sizePtr) : (TclGetStringFromObj)(objPtr, (size_t *)sizePtr)) #define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) \ @@ -4169,8 +4177,7 @@ extern const TclStubs *tclStubsPtr; (sizeof(*sizePtr) <= sizeof(int) ? (Tcl_GetByteArrayFromObj)(objPtr, (int *)sizePtr) : TclGetByteArrayFromObj(objPtr, (size_t *)sizePtr)) #define Tcl_GetUnicodeFromObj(objPtr, sizePtr) \ (sizeof(*sizePtr) <= sizeof(int) ? (Tcl_GetUnicodeFromObj)(objPtr, (int *)sizePtr) : TclGetUnicodeFromObj(objPtr, (size_t *)sizePtr)) -#define Tcl_GetUnicode(objPtr) \ - (Tcl_GetUnicodeFromObj)(objPtr, NULL) +#endif #endif #undef Tcl_NewLongObj diff --git a/generic/tclObj.c b/generic/tclObj.c index 882ec6b..421c1da 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -1617,6 +1617,7 @@ TclSetDuplicateObj( *---------------------------------------------------------------------- */ +#undef Tcl_GetString char * Tcl_GetString( Tcl_Obj *objPtr) /* Object whose string rep byte pointer should diff --git a/generic/tclPlatDecls.h b/generic/tclPlatDecls.h index 8a1c6a5..ee5ca50 100644 --- a/generic/tclPlatDecls.h +++ b/generic/tclPlatDecls.h @@ -40,6 +40,14 @@ # define _TCHAR_DEFINED #endif +#ifndef MODULE_SCOPE +# ifdef __cplusplus +# define MODULE_SCOPE extern "C" +# else +# define MODULE_SCOPE extern +# endif +#endif + /* !BEGIN!: Do not edit below this line. */ #ifdef __cplusplus diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index a199ea0..17546a4 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -1176,7 +1176,7 @@ TeststringobjCmd( { Tcl_UniChar *unicode; int varIndex, option, i, length; - size_t size; + int size; #define MAX_STRINGS 11 const char *index, *string, *strings[MAX_STRINGS+1]; String *strPtr; @@ -1371,7 +1371,7 @@ TeststringobjCmd( if (Tcl_GetIntFromObj(interp, objv[3], &i) != TCL_OK) { return TCL_ERROR; } - if ((i < 0) || ((size_t)i > size)) { + if ((i < 0) || (i > size)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "index value out of range", -1)); return TCL_ERROR; @@ -1402,7 +1402,7 @@ TeststringobjCmd( if (Tcl_GetIntFromObj(interp, objv[3], &i) != TCL_OK) { return TCL_ERROR; } - if ((i < 0) || ((size_t)i > size)) { + if ((i < 0) || (i > size)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "index value out of range", -1)); return TCL_ERROR; diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h index 4c1505f..62605fc 100644 --- a/generic/tclTomMathDecls.h +++ b/generic/tclTomMathDecls.h @@ -53,7 +53,11 @@ #define MP_FREE(mem, size) TclBNFree(mem) #ifndef MODULE_SCOPE -# define MODULE_SCOPE extern +# ifdef __cplusplus +# define MODULE_SCOPE extern "C" +# else +# define MODULE_SCOPE extern +# endif #endif #ifdef __cplusplus |