haiku/headers/private/libroot/locale/ICUThreadLocalStorageValue.h
Oliver Tappe ec99f3b2a6 Adjust mbstate_t to embed the state of the ICU converter.
* make room in mbstate_t for containing an ICU-converter's state
  (well, in fact the whole converter object)
* adjust libroot's locale add-on to clone converters into a given
  mbstate_t directly
* adjust ICUThreadLocalStorageValue to contain the converter pointer
  instead of a converter-ID (if the converter is related to an
  mbstate_t, it points into the mbstate_t).
* adjust users of converters to directly use converter pointers
  instead of ICUConverterRef
* drop now unused ICUConverterManager and ICUConverterRef
* update gcc4 optional package

This brings our multibyte implementation into a fully working state,
both non-ascii and non-8-bit characters can now be handled normally
in the Terminal, i.e. this finally fixes #6276.

N.B.: Since the size of mbstate_t has changed, everything (including
the compiler!) needs to be rebuilt.
2011-12-15 13:18:11 +01:00

37 lines
695 B
C++

/*
* Copyright 2011, Oliver Tappe, zooey@hirschkaefer.de.
* Distributed under the terms of the MIT License.
*/
#ifndef _ICU_THREAD_LOCAL_STORAGE_VALUE_H
#define _ICU_THREAD_LOCAL_STORAGE_VALUE_H
#include <pthread.h>
#include <unicode/ucnv.h>
#include <SupportDefs.h>
namespace BPrivate {
namespace Libroot {
struct ICUThreadLocalStorageValue {
UConverter* converter;
char charset[64];
ICUThreadLocalStorageValue();
~ICUThreadLocalStorageValue();
static status_t GetInstanceForKey(pthread_key_t tlsKey,
ICUThreadLocalStorageValue*& instanceOut);
};
} // namespace Libroot
} // namespace BPrivate
#endif // _ICU_THREAD_LOCAL_STORAGE_VALUE_H