diff options
Diffstat (limited to 'generic/tclInt.h')
| -rw-r--r-- | generic/tclInt.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 032a2f6..947d6ec 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.325 2007/07/31 17:03:38 msofer Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.326 2007/08/01 13:27:47 patthoyts Exp $ */ #ifndef _TCLINT @@ -3488,6 +3488,18 @@ MODULE_SCOPE void TclBNInitBignumFromWideUInt(mp_int *bignum, #endif /* + * ---------------------------------------------------------------------- + * Macro to use to find the offset of a field in a structure. + * Computes number of bytes from beginning of structure to a given field. + */ + +#ifdef offsetof +#define TclOffset(type, field) ((int) offsetof(type, field)) +#else +#define TclOffset(type, field) ((int) ((char *) &((type *) 0)->field)) +#endif + +/* *---------------------------------------------------------------- * Inline version of Tcl_GetCurrentNamespace and Tcl_GetGlobalNamespace */ |
