From owner-svn-src-all@FreeBSD.ORG Tue Feb 14 14:24:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14DDB1065674; Tue, 14 Feb 2012 14:24:38 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD66F8FC1F; Tue, 14 Feb 2012 14:24:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EEObfE002485; Tue, 14 Feb 2012 14:24:37 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EEObiH002481; Tue, 14 Feb 2012 14:24:37 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201202141424.q1EEObiH002481@svn.freebsd.org> From: David Chisnall Date: Tue, 14 Feb 2012 14:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231682 - in head: include lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 14:24:38 -0000 Author: theraven Date: Tue Feb 14 14:24:37 2012 New Revision: 231682 URL: http://svn.freebsd.org/changeset/base/231682 Log: Fix a misplaced __NO_TLS locations, and change a GNUism to a C11ism for consistency. Approved by: brooks (mentor) Modified: head/include/runetype.h head/lib/libc/locale/setrunelocale.c head/lib/libc/locale/xlocale_private.h Modified: head/include/runetype.h ============================================================================== --- head/include/runetype.h Tue Feb 14 14:19:53 2012 (r231681) +++ head/include/runetype.h Tue Feb 14 14:24:37 2012 (r231682) @@ -86,10 +86,10 @@ typedef struct { __BEGIN_DECLS extern const _RuneLocale _DefaultRuneLocale; extern const _RuneLocale *_CurrentRuneLocale; -extern const _Thread_local _RuneLocale *_ThreadRuneLocale; #if defined(__NO_TLS) || defined(__RUNETYPE_INTERNAL) extern const _RuneLocale *__getCurrentRuneLocale(void); #else +extern const _Thread_local _RuneLocale *_ThreadRuneLocale; static inline const _RuneLocale *__getCurrentRuneLocale(void) { Modified: head/lib/libc/locale/setrunelocale.c ============================================================================== --- head/lib/libc/locale/setrunelocale.c Tue Feb 14 14:19:53 2012 (r231681) +++ head/lib/libc/locale/setrunelocale.c Tue Feb 14 14:24:37 2012 (r231682) @@ -183,6 +183,8 @@ __wrap_setrunelocale(const char *locale) _CurrentRuneLocale = __xlocale_global_ctype.runes; return (_LDP_LOADED); } + +#ifndef __NO_TLS void __set_thread_rune_locale(locale_t loc) { @@ -192,10 +194,11 @@ __set_thread_rune_locale(locale_t loc) { _ThreadRuneLocale = XLOCALE_CTYPE(loc)->runes; } } +#endif + void * __ctype_load(const char *locale, locale_t unused) { -#ifndef __NO_TLS struct xlocale_ctype *l = calloc(sizeof(struct xlocale_ctype), 1); l->header.header.destructor = destruct_ctype; if (__setrunelocale(l, locale)) @@ -204,5 +207,4 @@ __ctype_load(const char *locale, locale_ return NULL; } return l; -#endif } Modified: head/lib/libc/locale/xlocale_private.h ============================================================================== --- head/lib/libc/locale/xlocale_private.h Tue Feb 14 14:19:53 2012 (r231681) +++ head/lib/libc/locale/xlocale_private.h Tue Feb 14 14:24:37 2012 (r231682) @@ -183,7 +183,7 @@ extern int __has_thread_locale; * The per-thread locale. Avoids the need to use pthread lookup functions when * getting the per-thread locale. */ -extern __thread locale_t __thread_locale; +extern _Thread_local locale_t __thread_locale; /** * Returns the current locale for this thread, or the global locale if none is