patch by Jeffrey Yasskin for porting to Ubuntu Hardy. Everything was accepted except there were some bug fixes needed in <locale> for the __nolocale_* series. For the apple branch I ended up using templates instead of the var_args solution because it seemed both safer and more efficient.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@104516 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2010-05-24 17:49:41 +00:00
parent 2a59254a44
commit adff4895b2
21 changed files with 308 additions and 120 deletions

View File

@@ -17,10 +17,11 @@
#include "cstring"
#include "cwctype"
#include "__sso_allocator"
#include <libkern/OSAtomic.h>
#include <langinfo.h>
#include <stdlib.h>
// FIXME: Locales are hard.
#if __APPLE__
_LIBCPP_BEGIN_NAMESPACE_STD
namespace {
@@ -534,7 +535,7 @@ locale::id::__get()
void
locale::id::__init()
{
__id_ = OSAtomicIncrement32Barrier(&__next_id);
__id_ = __sync_add_and_fetch(&__next_id, 1);
}
// template <> class collate_byname<char>
@@ -3678,3 +3679,4 @@ template class codecvt_byname<char32_t, char, mbstate_t>;
template class __vector_base_common<true>;
_LIBCPP_END_NAMESPACE_STD
#endif /* __APPLE__ */