- diff --git a/Base/RovLocale.cpp b/Base/RovLocale.cpp
- index 90e735b..9d25380 100644
- --- a/Base/RovLocale.cpp
- +++ b/Base/RovLocale.cpp
- @@ -1,9 +1,19 @@
- +///////////////////////////////////////////////////////////////////////////////
- +// RovLocale.cpp POSIX i18n/l10n support functions
- +// Copyright acontis technologies GmbH, Weingarten, Germany
- +// Response Roland Mainz <roland.mainz@rovema.de>
- +// Description Support functions for i18n and l10n
- +///////////////////////////////////////////////////////////////////////////////
- #include "PosixSystem.hpp"
- -pthread_once_t posix_localeobj_init = PTHREAD_ONCE_INIT;
- +/*
- + * ToDo:
- + * - Add implementations of |printf_l()|/|sprintf_l()| etc.
- + */
- -static locale_t posix_localeobj = 0;
- +static pthread_once_t posix_localeobj_init = PTHREAD_ONCE_INIT;
- +static locale_t posix_localeobj = 0;
- static void init_posix_localeobj(void)
- {
- @@ -16,3 +26,4 @@ locale_t rov_get_posix_localeobj(void)
- return posix_localeobj;
- }
- +
- diff --git a/Rdc/RdsTypes.cpp b/Rdc/RdsTypes.cpp
- index 6b6861c..68c92b8 100755
- --- a/Rdc/RdsTypes.cpp
- +++ b/Rdc/RdsTypes.cpp
- @@ -724,7 +724,7 @@ RINLINE T_Bool g_ReadNumericalValueFromString (
- _eValueType);
- } // end if (!bOk)
- - #ifdef JNA
- +#ifdef JNA
- (void)uselocale(saved_locale);
- #endif
- return(bOk);
- diff --git a/Rdc/RdsUnit.h b/Rdc/RdsUnit.h
- index 1e3f903..ed39e22 100755
- --- a/Rdc/RdsUnit.h
- +++ b/Rdc/RdsUnit.h
- @@ -559,22 +559,11 @@ public:
- //******************************************************************************
- RINLINE T_Bool C_RdsUnitSize::convertString2Double(const string &_anyStr, T_Double64 & _anyDouble)
- {
- -#ifdef JNA
- - locale_t saved_locale;
- - locale_t posix_locale;
- -
- - /*
- - * Use POSIX locale because the code below uses functions which
- - * parse floating-poing values using locale-specific functions
- - */
- - posix_locale = rov_get_posix_localeobj();
- - saved_locale = uselocale(posix_locale);
- -#endif
- + locale_t posix_locale = rov_get_posix_localeobj();
- +
- T_String stopStr = (T_String) _anyStr.c_str();
- - _anyDouble = strtod(stopStr, & stopStr);
- -#ifdef JNA
- - (void)uselocale(saved_locale);
- -#endif
- + _anyDouble = strtod_l(stopStr, & stopStr, posix_locale);
- +
- return true;
- } // end C_RdsUnitSize::convertString2Double
RDE i10n fixes, review feedback #002
Posted by Anonymous on Fri 12th May 2023 10:29
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.