Index: generic/nsf.c =================================================================== diff -u -N -rfebe765f7fac1308029fd203b89e974e3ded8ee4 -r8f7c25f980c5433948a27be3cab5bb15d754b921 --- generic/nsf.c (.../nsf.c) (revision febe765f7fac1308029fd203b89e974e3ded8ee4) +++ generic/nsf.c (.../nsf.c) (revision 8f7c25f980c5433948a27be3cab5bb15d754b921) @@ -10973,7 +10973,7 @@ if (newItem != 0) { Tcl_SetHashValue(hPtr, INT2PTR(1)); } else { - int count = PTR2INT(Tcl_GetHashValue(hPtr)); + long count = PTR2INT(Tcl_GetHashValue(hPtr)); Tcl_SetHashValue(hPtr, INT2PTR(count+1)); } } @@ -13866,7 +13866,7 @@ if (ttPtr != NULL) { const char *methodName = data[0]; - unsigned int cmdFlags = PTR2UINT(data[3]); + unsigned int cmdFlags = (unsigned int)PTR2UINT(data[3]); #if defined(NSF_PROFILE) NsfRuntimeState *rst = RUNTIME_STATE(interp); #endif @@ -23380,7 +23380,8 @@ const char *errorMsg = ObjStr(resultObj); INCR_REF_COUNT(resultObj); - fprintf(stderr, "==== DEBUG AppVeyor: calling NsfForwardPrintError with <<%s>> (len %lu)\n", errorMsg, strlen(errorMsg)); + fprintf(stderr, "==== DEBUG AppVeyor: calling NsfForwardPrintError with <<%s>> (len %lu)\n", + errorMsg, (unsigned long)strlen(errorMsg)); result = NsfForwardPrintError(interp, tcd, objc, objv, "%s", errorMsg); DECR_REF_COUNT(resultObj); } Index: generic/nsfAccessInt.h =================================================================== diff -u -N -ra963e8896fd07c345ccfa034cbd043344edbf083 -r8f7c25f980c5433948a27be3cab5bb15d754b921 --- generic/nsfAccessInt.h (.../nsfAccessInt.h) (revision a963e8896fd07c345ccfa034cbd043344edbf083) +++ generic/nsfAccessInt.h (.../nsfAccessInt.h) (revision 8f7c25f980c5433948a27be3cab5bb15d754b921) @@ -81,6 +81,14 @@ #define Tcl_Command_deleteProc(cmd) ((Command *)(cmd))->deleteProc #define Tcl_Command_deleteData(cmd) ((Command *)(cmd))->deleteData +/* + * The offsetof() macro is an ANSI C library feature. + * Workaround for platforms missing offsetof(), e.g. VC++ 6.0 + */ +#ifndef offsetof +# define offsetof(type, field) ((size_t) ((char *) &((type *) 0)->field)) +#endif + /* * Var Reform Compatibility support. * @@ -91,7 +99,7 @@ #define TclIsCompiledLocalArgument(compiledLocalPtr) ((compiledLocalPtr)->flags & VAR_ARGUMENT) #define TclIsCompiledLocalTemporary(compiledLocalPtr) ((compiledLocalPtr)->flags & VAR_TEMPORARY) -#define TclVarHashGetValue(hPtr) ((Var *) ((char *)(hPtr) - TclOffset(VarInHash, entry))) +#define TclVarHashGetValue(hPtr) ((Var *) ((char *)(hPtr) - offsetof(VarInHash, entry))) #define TclVarHashGetKey(varPtr) (((VarInHash *)(varPtr))->entry.key.objPtr) #define TclVarHashTablePtr(varTablePtr) &(varTablePtr)->table #define TclVarValue(type, varPtr, field) (type *)(varPtr)->value.field