diff options
| author | das <das> | 2006-09-10 17:04:05 (GMT) | 
|---|---|---|
| committer | das <das> | 2006-09-10 17:04:05 (GMT) | 
| commit | 99f4722bc1aaac286a7546f99abffdea5549c915 (patch) | |
| tree | c24aaa06cacae7000c359d5823a4ea95e235ac66 /unix/tclUnixInit.c | |
| parent | 22f04a9312703adbda93e367fc6af2064f1b14a3 (diff) | |
| download | tcl-99f4722bc1aaac286a7546f99abffdea5549c915.zip tcl-99f4722bc1aaac286a7546f99abffdea5549c915.tar.gz tcl-99f4722bc1aaac286a7546f99abffdea5549c915.tar.bz2 | |
	* library/msgcat/msgcat.tcl (msgcat::Init): on Darwin, add fallback of
	* tests/msgcat.test:                        default msgcat locale to
	* unix/tclUnixInit.c (TclpSetVariables):    current CFLocale identifier
	if available (via private ::tcl::mac::locale global, set at interp init
	when on Mac OS X 10.3 or later with CoreFoundation).
	* library/tcltest/tcltest.tcl: add 'line' verbose level: prints source
	* doc/tcltest.n:               file line information of failing tests.
	* macosx/Tcl.xcodeproj/project.pbxproj: add new tclUnixCompat.c file;
	revise tests target to use new tcltest 'line' verbose level.
	* unix/configure.in: add descriptions to new AC_DEFINEs for MT-safe.
	* unix/tcl.m4: add caching to new SC_TCL_* macros for MT-safe wrappers.
	* unix/configure: autoconf-2.59
	* unix/tclConfig.h.in: autoheader-2.59
Diffstat (limited to 'unix/tclUnixInit.c')
| -rw-r--r-- | unix/tclUnixInit.c | 26 | 
1 files changed, 25 insertions, 1 deletions
| diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 6fe79d9..7db0e4c 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.66 2006/08/29 05:33:36 mistachkin Exp $ + * RCS: @(#) $Id: tclUnixInit.c,v 1.67 2006/09/10 17:04:07 das Exp $   */  #include "tclInt.h" @@ -766,6 +766,30 @@ TclpSetVariables(  #ifdef HAVE_COREFOUNDATION      char tclLibPath[MAXPATHLEN + 1]; +#if MAC_OS_X_VERSION_MAX_ALLOWED > 1020 +    /* +     * Set msgcat fallback locale to current CFLocale identifier. +     */ +    CFLocaleRef localeRef; +     +    if (CFLocaleCopyCurrent != NULL && CFLocaleGetIdentifier != NULL && +	    (localeRef = CFLocaleCopyCurrent())) { +	CFStringRef locale = CFLocaleGetIdentifier(localeRef); + +	if (locale) { +	    char loc[256]; + +	    if (CFStringGetCString(locale, loc, 256, kCFStringEncodingUTF8)) { +		if (!Tcl_CreateNamespace(interp, "::tcl::mac", NULL, NULL)) { +		    Tcl_ResetResult(interp); +		} +		Tcl_SetVar(interp, "::tcl::mac::locale", loc, TCL_GLOBAL_ONLY); +	    } +	} +	CFRelease(localeRef); +    } +#endif +      if (MacOSXGetLibraryPath(interp, MAXPATHLEN, tclLibPath) == TCL_OK) {  	CONST char *str;  	Tcl_DString ds; | 
