diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 15e2185843..c092b763fc 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,18 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-10-19 14:54 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/common/hbwince.c + + added GetEnvironmentVariableW() - it fixes WinCE builds after recent + ANSI to UNICODE function conversions. In WINCE such functions do not + exist. + + * harbour/src/rtl/gtclip.c + * pacified MinGWCE warnings + + * harbour/src/rtl/dateshb.c + + added HB_TTOD() and HB_DTOT() functions + 2009-10-19 11:53 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbexprb.c ! always optimized ASC() and LEN() functions (was disabled by -kc switch). diff --git a/harbour/src/common/hbwince.c b/harbour/src/common/hbwince.c index 70961dbf92..23e4f48c30 100644 --- a/harbour/src/common/hbwince.c +++ b/harbour/src/common/hbwince.c @@ -228,6 +228,36 @@ DWORD WINAPI GetEnvironmentVariableA( LPCSTR name, LPSTR value, DWORD size ) return size; } +DWORD WINAPI GetEnvironmentVariableW( LPCWSTR name, LPWSTR value, DWORD size ) +{ + /* use registry instead of "environment valuable". */ + HKEY hk; + LONG lret; + DWORD dwType = REG_SZ, result = 0; + + lret = RegOpenKeyEx( HKEY_LOCAL_MACHINE, TEXT( "Software\\harbour_mswince" ), 0, KEY_QUERY_VALUE, &hk ); + + if( lret != ERROR_SUCCESS ) + { + if( value && size ) + value[ 0 ] = '\0'; + return 0; + } + + result = size * sizeof( TCHAR ); + lret = RegQueryValueExW( hk, name, NULL, &dwType, ( LPBYTE ) value, &result ); + RegCloseKey( hk ); + + if( lret != ERROR_SUCCESS ) + { + if( value && size ) + value[ 0 ] = '\0'; + return value ? 0 : result; + } + + return result; +} + BOOL WINAPI SetEnvironmentVariableA( LPCSTR name, LPCSTR value ) { HB_SYMBOL_UNUSED( name ); diff --git a/harbour/src/rtl/dateshb.c b/harbour/src/rtl/dateshb.c index 4ca25717ca..685be62882 100644 --- a/harbour/src/rtl/dateshb.c +++ b/harbour/src/rtl/dateshb.c @@ -229,6 +229,26 @@ HB_FUNC( HB_DATETIME ) hb_rettdt( lDate, lTime ); } +HB_FUNC( HB_DTOT ) +{ + long lDate, lTime; + + if( hb_partdt( &lDate, &lTime, 1 ) ) + hb_retdl( lDate ); + else + hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); +} + +HB_FUNC( HB_TTOD ) +{ + long lDate, lTime; + + if( hb_partdt( &lDate, &lTime, 1 ) ) + hb_rettdt( lDate, lTime ); + else + hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); +} + HB_FUNC( HB_NTOT ) { PHB_ITEM pNum = hb_param( 1, HB_IT_NUMERIC ); diff --git a/harbour/src/rtl/gtclip.c b/harbour/src/rtl/gtclip.c index 9b8a30db3d..acfb7be2db 100644 --- a/harbour/src/rtl/gtclip.c +++ b/harbour/src/rtl/gtclip.c @@ -140,7 +140,7 @@ BOOL hb_gt_winapi_setClipboard( UINT uFormat, const char * szClipData, ULONG ulL } fResult = TRUE; } - GlobalUnlock( hglbCopy ); + ( void ) GlobalUnlock( hglbCopy ); /* Place the handle on the clipboard. */ SetClipboardData( uFormat, hglbCopy ); } @@ -188,7 +188,7 @@ BOOL hb_gt_winapi_getClipboard( UINT uFormat, char ** pszClipData, ULONG *pulLen } break; } - GlobalUnlock( hglb ); + ( void ) GlobalUnlock( hglb ); } } CloseClipboard();