diff --git a/ChangeLog.txt b/ChangeLog.txt index 2c3686cb19..4e1efafde5 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,10 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2016-09-23 09:47 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * contrib/gtqtc/gtqtc1.cpp + ! fixed C++ casting in MS-Windows builds + 2016-09-22 15:47 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * include/hbapi.h * include/hbvmpub.h diff --git a/contrib/gtqtc/gtqtc1.cpp b/contrib/gtqtc/gtqtc1.cpp index 116ebe782a..a38136f26e 100644 --- a/contrib/gtqtc/gtqtc1.cpp +++ b/contrib/gtqtc/gtqtc1.cpp @@ -94,16 +94,26 @@ static void hb_gt_qtc_itemGetQString( PHB_ITEM pItem, QString * pqStr ) if( ( wStr = hb_itemGetStrU16( pItem, HB_CDP_ENDIAN_NATIVE, &hStr, &nSize ) ) != NULL ) { +#if defined( HB_OS_WIN ) + * pqStr = QString::fromWCharArray( wStr, nSize ); +#else * pqStr = QString::fromUtf16( static_cast< const ushort * >( wStr ), nSize ); +#endif hb_strfree( hStr ); } } static PHB_ITEM hb_gt_qtc_itemPutQString( PHB_ITEM pItem, const QString * pqStr ) { +#if defined( HB_OS_WIN ) + return hb_itemPutStrLenU16( pItem, HB_CDP_ENDIAN_NATIVE, + reinterpret_cast< const HB_WCHAR * >( pqStr->utf16() ), + pqStr->size() ); +#else return hb_itemPutStrLenU16( pItem, HB_CDP_ENDIAN_NATIVE, static_cast< const HB_WCHAR * >( pqStr->utf16() ), pqStr->size() ); +#endif } /* *********************************************************************** */