From a70545f044df014691de40703123cfc21c68a806 Mon Sep 17 00:00:00 2001 From: vbwagner Date: Tue, 9 Mar 2004 13:34:45 +0000 Subject: Fixed incorrect reporting of OS version for DJGPP. This known misinterpretation of uts_name struct fields is now considered "feature" of DJGPP and so needs workaround in Tcl. --- unix/tclUnixInit.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 39a8138..12a99d4 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -7,7 +7,7 @@ * Copyright (c) 1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tclUnixInit.c,v 1.38 2004/02/17 23:50:39 hobbs Exp $ + * RCS: @(#) $Id: tclUnixInit.c,v 1.39 2004/03/09 13:34:45 vbwagner Exp $ */ #if defined(HAVE_CFBUNDLE) @@ -830,12 +830,25 @@ TclpSetVariables(interp) Tcl_SetVar2(interp, "tcl_platform", "osVersion", name.release, TCL_GLOBAL_ONLY); } else { +#ifdef DJGPP + /* For some obscure reason DJGPP puts major version into + * name.release and minor into name.version. As of DJGPP 2.04 + * this is documented in djgpp libc.info file*/ + Tcl_SetVar2(interp, "tcl_platform", "osVersion", name.release, + TCL_GLOBAL_ONLY); + Tcl_SetVar2(interp, "tcl_platform", "osVersion", ".", + TCL_GLOBAL_ONLY|TCL_APPEND_VALUE); + Tcl_SetVar2(interp, "tcl_platform", "osVersion", name.version, + TCL_GLOBAL_ONLY|TCL_APPEND_VALUE); +#else Tcl_SetVar2(interp, "tcl_platform", "osVersion", name.version, TCL_GLOBAL_ONLY); Tcl_SetVar2(interp, "tcl_platform", "osVersion", ".", TCL_GLOBAL_ONLY|TCL_APPEND_VALUE); Tcl_SetVar2(interp, "tcl_platform", "osVersion", name.release, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE); + +#endif } Tcl_SetVar2(interp, "tcl_platform", "machine", name.machine, TCL_GLOBAL_ONLY); -- cgit v0.12