git-svn-id: svn://db.shs.com.ru/pip@901 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2020-03-05 13:16:53 +00:00
parent d6f7e261b2
commit 5c6d9feb3d
6 changed files with 142 additions and 621 deletions

View File

@@ -92,6 +92,7 @@ PRIVATE_DEFINITION_START(PIInit)
#ifdef WINDOWS
HMODULE ntlib;
ULONG prev_res;
bool delete_locs;
#endif
PRIVATE_DEFINITION_END(PIInit)
@@ -186,13 +187,16 @@ PIInit::PIInit() {
actions.sa_handler = android_thread_exit_handler;
sigaction(SIGTERM, &actions, 0);
#endif
#ifdef PIP_ICU
PRIVATE->delete_locs = false;
__syslocname__ = __sysoemname__ = 0;
__utf8name__ = "UTF-8";
#ifdef PIP_ICU
//__syslocname__ = new char[256];
//memset(__syslocname__, 0, 256);
UErrorCode e((UErrorCode)0);
u_init(&e);
# ifdef WINDOWS
PRIVATE->delete_locs = true;
CPINFOEX cpinfo;
int l = 0;
/*GetCPInfoEx(CP_ACP, 0, &cpinfo);
@@ -218,6 +222,12 @@ PIInit::PIInit() {
# endif
//piCout << __syslocname__;
//piCout << __sysoemname__;
#else
# ifdef WINDOWS
__syslocname__ = (char *)CP_ACP;
__sysoemname__ = (char *)CP_OEMCP;
__utf8name__ = (char *)CP_UTF8;
# endif
#endif
#ifdef MAC_OS
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &__pi_mac_clock);
@@ -315,9 +325,11 @@ PIInit::~PIInit() {
#ifdef MAC_OS
mach_port_deallocate(mach_task_self(), __pi_mac_clock);
#endif
if (PRIVATE->delete_locs) {
if (__syslocname__) delete __syslocname__;
if (__sysoemname__) delete __sysoemname__;
}
#ifdef PIP_ICU
if (__syslocname__) delete __syslocname__;
if (__sysoemname__) delete __sysoemname__;
u_cleanup();
#endif
//if (currentLocale_t != 0) freelocale(currentLocale_t);