summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortheraven <theraven@FreeBSD.org>2012-02-14 14:24:37 +0000
committertheraven <theraven@FreeBSD.org>2012-02-14 14:24:37 +0000
commit21ab7f5574b22af50aa84bb2c5f4944ba8152572 (patch)
treea389acef83de13625cd9b22d4ac1dfc213ccd72a /lib
parenta89581c07f0ad3b2381b871ea3abe6875b4905a6 (diff)
downloadFreeBSD-src-21ab7f5574b22af50aa84bb2c5f4944ba8152572.zip
FreeBSD-src-21ab7f5574b22af50aa84bb2c5f4944ba8152572.tar.gz
Fix a misplaced __NO_TLS locations, and change a GNUism to a C11ism for
consistency. Approved by: brooks (mentor)
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/locale/setrunelocale.c6
-rw-r--r--lib/libc/locale/xlocale_private.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c
index d2e3320..bc04e9e 100644
--- a/lib/libc/locale/setrunelocale.c
+++ b/lib/libc/locale/setrunelocale.c
@@ -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_t unused)
return NULL;
}
return l;
-#endif
}
diff --git a/lib/libc/locale/xlocale_private.h b/lib/libc/locale/xlocale_private.h
index 0110060..8b4a26d 100644
--- a/lib/libc/locale/xlocale_private.h
+++ b/lib/libc/locale/xlocale_private.h
@@ -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
OpenPOWER on IntegriCloud