From b822fa0dbfdffb08a7dfac1e8c60a945f70da788 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 18 Jan 2010 19:37:26 +0000 Subject: [PATCH] 2010-01-18 20:32 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/vm/extrap.c * src/rtl/diskspac.c * src/rtl/disksphb.c * src/rtl/gtwvt/gtwvt.c * contrib/gtwvg/gtwvg.c * contrib/gtwvg/wvgwin.c * contrib/hbwin/win_prn2.c * contrib/hbwin/win_prn3.c + Using HBTEXT() macro on 2nd parameter of GetProcAddress() in _all_ cases. This can't hurt, but it's useful to never forget it for WinCE targets/branches. Recent change got also simplified after this. Pls review me. --- harbour/ChangeLog | 15 +++++++++++++++ harbour/contrib/gtwvg/gtwvg.c | 12 ++++++------ harbour/contrib/gtwvg/wvgwin.c | 4 ++-- harbour/contrib/hbwin/win_prn2.c | 8 +++----- harbour/contrib/hbwin/win_prn3.c | 8 +++----- harbour/src/rtl/diskspac.c | 4 ++-- harbour/src/rtl/disksphb.c | 4 ++-- harbour/src/rtl/gtwvt/gtwvt.c | 8 +------- harbour/src/vm/extrap.c | 6 +++--- 9 files changed, 37 insertions(+), 32 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 351853ace0..e164e84ccc 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,21 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-18 20:32 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/vm/extrap.c + * src/rtl/diskspac.c + * src/rtl/disksphb.c + * src/rtl/gtwvt/gtwvt.c + * contrib/gtwvg/gtwvg.c + * contrib/gtwvg/wvgwin.c + * contrib/hbwin/win_prn2.c + * contrib/hbwin/win_prn3.c + + Using HBTEXT() macro on 2nd parameter of GetProcAddress() + in _all_ cases. This can't hurt, but it's useful to never + forget it for WinCE targets/branches. + Recent change got also simplified after this. + Pls review me. + 2010-01-18 20:08 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/hbwin/win_tprn.prg ! fixed GetDefaultPrinter() => win_PrinterGetDefault() diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index 4466add530..f744c81a9d 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -2561,11 +2561,11 @@ static HB_BOOL hb_gt_wvt_CreateConsoleWindow( PHB_GTWVT pWVT ) #if defined( UNICODE ) && defined( GetProcAddress ) P_SLWA pSetLayeredWindowAttributes = ( P_SLWA ) GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ), - TEXT( "SetLayeredWindowAttributes" ) ); + HBTEXT( "SetLayeredWindowAttributes" ) ); #else P_SLWA pSetLayeredWindowAttributes = ( P_SLWA ) GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ), - "SetLayeredWindowAttributes" ); + HBTEXT( "SetLayeredWindowAttributes" ) ); #endif if( pSetLayeredWindowAttributes ) @@ -4200,9 +4200,9 @@ static void hb_wvt_gtLoadGuiData( void ) { /* workaround for wrong declarations in some old C compilers */ #if defined( UNICODE ) && defined( GetProcAddress ) - s_guiData->pfnGF = ( wvtGradientFill ) GetProcAddressW( h, TEXT( "GradientFill" ) ); + s_guiData->pfnGF = ( wvtGradientFill ) GetProcAddressW( h, HBTEXT( "GradientFill" ) ); #else - s_guiData->pfnGF = ( wvtGradientFill ) GetProcAddress( h, "GradientFill" ); + s_guiData->pfnGF = ( wvtGradientFill ) GetProcAddress( h, HBTEXT( "GradientFill" ) ); #endif if( s_guiData->pfnGF ) { @@ -4215,9 +4215,9 @@ static void hb_wvt_gtLoadGuiData( void ) { /* workaround for wrong declarations in some old C compilers */ #if defined( UNICODE ) && defined( GetProcAddress ) - s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddressW( h, TEXT( "SetLayeredWindowAttributes" ) ); + s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddressW( h, HBTEXT( "SetLayeredWindowAttributes" ) ); #else - s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, "SetLayeredWindowAttributes" ); + s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, HBTEXT( "SetLayeredWindowAttributes" ) ); #endif if( s_guiData->pfnLayered ) { diff --git a/harbour/contrib/gtwvg/wvgwin.c b/harbour/contrib/gtwvg/wvgwin.c index acb3315a30..844fdb0eaf 100644 --- a/harbour/contrib/gtwvg/wvgwin.c +++ b/harbour/contrib/gtwvg/wvgwin.c @@ -1160,9 +1160,9 @@ HB_FUNC( WVG_SETLAYEREDWINDOWATTRIBUTES ) if( h ) { #if defined( UNICODE ) && defined( GetProcAddress ) - pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddressW( h, TEXT( "SetLayeredWindowAttributes" ) ); + pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddressW( h, HBTEXT( "SetLayeredWindowAttributes" ) ); #else - pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, "SetLayeredWindowAttributes" ); + pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, HBTEXT( "SetLayeredWindowAttributes" ) ); #endif if( pfnLayered ) { diff --git a/harbour/contrib/hbwin/win_prn2.c b/harbour/contrib/hbwin/win_prn2.c index 2af74b3e39..443d924178 100644 --- a/harbour/contrib/hbwin/win_prn2.c +++ b/harbour/contrib/hbwin/win_prn2.c @@ -139,12 +139,10 @@ static void hb_GetDefaultPrinter( PHB_ITEM pPrinterName ) if( hWinSpool ) { fnGetDefaultPrinter = ( DEFPRINTER ) GetProcAddress( hWinSpool, -#if defined( HB_OS_WIN_CE ) - TEXT( "GetDefaultPrinterW" ) ); -#elif defined( UNICODE ) - "GetDefaultPrinterW" ); +#if defined( UNICODE ) + HBTEXT( "GetDefaultPrinterW" ) ); #else - "GetDefaultPrinterA" ); + HBTEXT( "GetDefaultPrinterA" ) ); #endif if( fnGetDefaultPrinter ) diff --git a/harbour/contrib/hbwin/win_prn3.c b/harbour/contrib/hbwin/win_prn3.c index 056941cda6..737825716d 100644 --- a/harbour/contrib/hbwin/win_prn3.c +++ b/harbour/contrib/hbwin/win_prn3.c @@ -168,12 +168,10 @@ static HB_BOOL hb_SetDefaultPrinter( LPCTSTR lpPrinterName ) if( ! hWinSpool ) return HB_FALSE; fnSetDefaultPrinter = ( DEFPRINTER ) GetProcAddress( hWinSpool, -#if defined( HB_OS_WIN_CE ) - TEXT( "SetDefaultPrinterW" ) ); -#elif defined( UNICODE ) - "SetDefaultPrinterW" ); +#if defined( UNICODE ) + HBTEXT( "SetDefaultPrinterW" ) ); #else - "SetDefaultPrinterA" ); + HBTEXT( "SetDefaultPrinterA" ) ); #endif if( ! fnSetDefaultPrinter ) { diff --git a/harbour/src/rtl/diskspac.c b/harbour/src/rtl/diskspac.c index ac27237de1..ecf925f9f1 100644 --- a/harbour/src/rtl/diskspac.c +++ b/harbour/src/rtl/diskspac.c @@ -142,9 +142,9 @@ HB_FUNC( DISKSPACE ) P_GDFSE pGetDiskFreeSpaceEx = ( P_GDFSE ) GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), #if defined( UNICODE ) - "GetDiskFreeSpaceExW" ); + HBTEXT( "GetDiskFreeSpaceExW" ) ); #else - "GetDiskFreeSpaceExA" ); + HBTEXT( "GetDiskFreeSpaceExA" ) ); #endif if( pGetDiskFreeSpaceEx ) diff --git a/harbour/src/rtl/disksphb.c b/harbour/src/rtl/disksphb.c index 3976caacab..8f693df34d 100644 --- a/harbour/src/rtl/disksphb.c +++ b/harbour/src/rtl/disksphb.c @@ -213,9 +213,9 @@ HB_FUNC( HB_DISKSPACE ) P_GDFSE pGetDiskFreeSpaceEx = ( P_GDFSE ) GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), #if defined( UNICODE ) - "GetDiskFreeSpaceExW" ); + HBTEXT( "GetDiskFreeSpaceExW" ) ); #else - "GetDiskFreeSpaceExA" ); + HBTEXT( "GetDiskFreeSpaceExA" ) ); #endif if( pGetDiskFreeSpaceEx ) diff --git a/harbour/src/rtl/gtwvt/gtwvt.c b/harbour/src/rtl/gtwvt/gtwvt.c index 64a5b81f5e..c5ff967f4f 100644 --- a/harbour/src/rtl/gtwvt/gtwvt.c +++ b/harbour/src/rtl/gtwvt/gtwvt.c @@ -1860,15 +1860,9 @@ static HB_BOOL hb_gt_wvt_CreateConsoleWindow( PHB_GTWVT pWVT ) { typedef BOOL ( WINAPI * P_SLWA )( HWND, COLORREF, BYTE, DWORD ); -#if defined( HB_OS_WIN_CE ) P_SLWA pSetLayeredWindowAttributes = ( P_SLWA ) GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ), - TEXT( "SetLayeredWindowAttributes" ) ); -#else - P_SLWA pSetLayeredWindowAttributes = ( P_SLWA ) - GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ), - "SetLayeredWindowAttributes" ); -#endif + HBTEXT( "SetLayeredWindowAttributes" ) ); if( pSetLayeredWindowAttributes ) { diff --git a/harbour/src/vm/extrap.c b/harbour/src/vm/extrap.c index a569ec7b7b..8e8f2ca06a 100644 --- a/harbour/src/vm/extrap.c +++ b/harbour/src/vm/extrap.c @@ -235,9 +235,9 @@ static LONG WINAPI hb_winExceptionHandler( struct _EXCEPTION_POINTERS * pExcepti typedef BOOL ( WINAPI * P_M32F )( HANDLE, LPMODULEENTRY32 ); /* Module32First() */ typedef BOOL ( WINAPI * P_M32N )( HANDLE, LPMODULEENTRY32 ); /* Module32Next() */ - P_CTH32SSH pCreateToolhelp32Snapshot = ( P_CTH32SSH ) GetProcAddress( hKernel32, "CreateToolhelp32Snapshot" ); - P_M32F pModule32First = ( P_M32F ) GetProcAddress( hKernel32, "Module32First" ); - P_M32N pModule32Next = ( P_M32N ) GetProcAddress( hKernel32, "Module32Next" ); + P_CTH32SSH pCreateToolhelp32Snapshot = ( P_CTH32SSH ) GetProcAddress( hKernel32, HBTEXT( "CreateToolhelp32Snapshot" ) ); + P_M32F pModule32First = ( P_M32F ) GetProcAddress( hKernel32, HBTEXT( "Module32First" ) ); + P_M32N pModule32Next = ( P_M32N ) GetProcAddress( hKernel32, HBTEXT( "Module32Next" ) ); if( pCreateToolhelp32Snapshot && pModule32First &&