diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-05-12 13:09:00 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-05-12 13:09:00 (GMT) |
commit | ec5c5c277f107a8e3cd0e40160019687d18f001b (patch) | |
tree | 75a5c3772a33a259aadabfd1518ce0c5e4ede5dd /generic/tclInt.h | |
parent | f779f4219c9a9bdc0c7cd766fbb0e9564936bdd9 (diff) | |
download | tcl-ec5c5c277f107a8e3cd0e40160019687d18f001b.zip tcl-ec5c5c277f107a8e3cd0e40160019687d18f001b.tar.gz tcl-ec5c5c277f107a8e3cd0e40160019687d18f001b.tar.bz2 |
Possible fix for [47d66253c92197d30bff280b02e0a9e62f07cee2|47d66253c9]: "lsearch -sorted -integer" on 64bit systembug_47d66253c9
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index d775a4a..b1a368e 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2453,6 +2453,30 @@ typedef struct List { #endif /* + * Macro used to save a function call for common uses of + * Tcl_GetWideIntFromObj(). The ANSI C "prototype" is: + * + * MODULE_SCOPE int TclGetWideIntFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, + * Tcl_WideInt *wideIntPtr); + */ + +#ifdef TCL_WIDE_INT_IS_LONG +#define TclGetWideIntFromObj(interp, objPtr, wideIntPtr) \ + (((objPtr)->typePtr == &tclIntType) \ + ? (*(wideIntPtr) = (Tcl_WideInt) \ + ((objPtr)->internalRep.longValue), TCL_OK) : \ + Tcl_GetWideIntFromObj((interp), (objPtr), (wideIntPtr))) +#else /* !TCL_WIDE_INT_IS_LONG */ +#define TclGetWideIntFromObj(interp, objPtr, wideIntPtr) \ + (((objPtr)->typePtr == &tclWideIntType) \ + ? (*(wideIntPtr) = (objPtr)->internalRep.wideValue, TCL_OK) : \ + ((objPtr)->typePtr == &tclIntType) \ + ? (*(wideIntPtr) = (Tcl_WideInt) \ + ((objPtr)->internalRep.longValue), TCL_OK) : \ + Tcl_GetWideIntFromObj((interp), (objPtr), (wideIntPtr))) +#endif /* TCL_WIDE_INT_IS_LONG */ + +/* * Flag values for TclTraceDictPath(). * * DICT_PATH_READ indicates that all entries on the path must exist but no |