diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 39fd38555f..d134f33475 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,27 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-11 12:32 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/direct.c + * int -> HB_SIZE + + * contrib/hbwin/wapi_wingdi.c + ! Fixed return value of WAPI_SELECTOBJECT() + + * contrib/hbwin/tests/testdll.prg + + Minor. + + * contrib/hbwin/win_dll.c + ! Fixed typo in byref parameter handling. Thanks to + Xavi for noticing it. + * Deleted unused union members from win32 retval support, + renamed the rest. + + * utils/hbmk2/hbmk2.prg + + Added -3rd= option. This is always ignored by hbmk2 and it + allows to store extra, non-hbmk2 information in hbmk2 make files. + F.e.: -3rd=-hbide_friendlyname=MyProject + 2010-02-11 04:25 UTC+0100 Xavi (jarabal/at/gmail.com) * contrib/hbwin/wapi_winbase.c + Added wapi_GETSHORTPATHNAME() diff --git a/harbour/contrib/hbwin/tests/testdll.prg b/harbour/contrib/hbwin/tests/testdll.prg index 52fff71185..6a7128de62 100644 --- a/harbour/contrib/hbwin/tests/testdll.prg +++ b/harbour/contrib/hbwin/tests/testdll.prg @@ -108,6 +108,6 @@ PROCEDURE Main() ? "DLLCALL" cData := Space( MAX_PATH ) ? DllCall( "shell32.dll", NIL, "SHGetFolderPath", 0, CSIDL_ADMINTOOLS, 0, 0, @cData ) - ? cData + ? "REF:", cData RETURN diff --git a/harbour/contrib/hbwin/wapi_wingdi.c b/harbour/contrib/hbwin/wapi_wingdi.c index f620d17bc6..3168d76647 100644 --- a/harbour/contrib/hbwin/wapi_wingdi.c +++ b/harbour/contrib/hbwin/wapi_wingdi.c @@ -628,7 +628,7 @@ HB_FUNC( WAPI_SELECTOBJECT ) { /* TODO: Solve reference counting to 'h' handle. Also for returned one. */ if( bRegion ) - hb_retni( ( int ) SelectObject( hDC, h ) ); + wapi_ret_HANDLE( SelectObject( hDC, h ) ); else hb_retl( SelectObject( hDC, h ) != NULL ); /* NOTE: We don't return a raw pointer. */ } diff --git a/harbour/contrib/hbwin/win_dll.c b/harbour/contrib/hbwin/win_dll.c index af4b03b775..335caa3ff1 100644 --- a/harbour/contrib/hbwin/win_dll.c +++ b/harbour/contrib/hbwin/win_dll.c @@ -132,12 +132,10 @@ typedef union { /* Various result types */ - int Int; /* Generic four-byte type */ - long Long; /* Four-byte long */ - void * Pointer; /* 32-bit pointer */ - float Float; /* Four byte real */ - double Double; /* 8-byte real */ - __int64 int64; /* big int (64-bit) */ + int ret_int; /* Generic four-byte type */ + long ret_long; /* Four-byte long */ + float ret_float; /* Four byte real */ + double ret_double; /* 8-byte real */ } HB_DYNRETVAL; typedef struct @@ -266,8 +264,8 @@ static HB_DYNRETVAL hb_DynaCall( int iFlags, FARPROC lpFunction, int nArgs, HB_D } else if( pRet == NULL ) { - Res.Int = dwEAX; - ( &Res.Int )[ 1 ] = dwEDX; + Res.ret_int = dwEAX; + ( &Res.ret_int )[ 1 ] = dwEDX; } else if( ( ( iFlags & DC_BORLAND ) == 0 ) && ( nRetSiz <= 8 ) ) { @@ -575,7 +573,7 @@ static void hb_DllExec( int iCallFlags, int iRtype, FARPROC lpFunction, PHB_DLLE wcall.pArg = NULL; for( tmp = 0; tmp < iParams; ++tmp ) - wcall.pArg[ tmp ].bByRef = HB_ISBYREF( iFirst + 1 + tmp ); + wcall.pArg[ tmp ].bByRef = HB_ISBYREF( iFirst + tmp ); switch( iParams ) { @@ -601,7 +599,7 @@ static void hb_DllExec( int iCallFlags, int iRtype, FARPROC lpFunction, PHB_DLLE { if( wcall.pArg[ tmp ].bByRef ) { - switch( HB_ITEM_TYPE( hb_param( iFirst + 1 + tmp, HB_IT_ANY ) ) ) + switch( HB_ITEM_TYPE( hb_param( iFirst + tmp, HB_IT_ANY ) ) ) { case HB_IT_LOGICAL: hb_storl( wcall.pArg[ tmp ].nValue != 0, tmp ); @@ -788,7 +786,7 @@ static void hb_DllExec( int iCallFlags, int iRtype, FARPROC lpFunction, PHB_DLLE switch( iRtype ) { case CTYPE_BOOL: - hb_retl( rc.Long != 0 ); + hb_retl( rc.ret_long != 0 ); break; case CTYPE_VOID: @@ -797,30 +795,30 @@ static void hb_DllExec( int iCallFlags, int iRtype, FARPROC lpFunction, PHB_DLLE case CTYPE_CHAR: case CTYPE_UNSIGNED_CHAR: - hb_retni( ( char ) rc.Int ); + hb_retni( ( char ) rc.ret_int ); break; case CTYPE_SHORT: case CTYPE_UNSIGNED_SHORT: - hb_retni( ( int ) rc.Int ); + hb_retni( ( int ) rc.ret_int ); break; case CTYPE_INT: - hb_retni( ( int ) rc.Long ); + hb_retni( ( int ) rc.ret_long ); break; case CTYPE_LONG: - hb_retnl( ( long ) rc.Long ); + hb_retnl( ( long ) rc.ret_long ); break; case CTYPE_CHAR_PTR: case CTYPE_UNSIGNED_CHAR_PTR: - hb_retc( ( char * ) rc.Long ); + hb_retc( ( char * ) rc.ret_long ); break; case CTYPE_UNSIGNED_INT: case CTYPE_UNSIGNED_LONG: - hb_retnint( ( unsigned long ) rc.Long ); + hb_retnint( ( unsigned long ) rc.ret_long ); break; case CTYPE_INT_PTR: @@ -832,15 +830,15 @@ static void hb_DllExec( int iCallFlags, int iRtype, FARPROC lpFunction, PHB_DLLE case CTYPE_VOID_PTR: case CTYPE_FLOAT_PTR: case CTYPE_DOUBLE_PTR: - hb_retptr( ( void * ) rc.Long ); + hb_retptr( ( void * ) rc.ret_long ); break; case CTYPE_FLOAT: - hb_retnd( rc.Float ); + hb_retnd( rc.ret_float ); break; case CTYPE_DOUBLE: - hb_retnd( rc.Double ); + hb_retnd( rc.ret_double ); break; default: diff --git a/harbour/src/rtl/direct.c b/harbour/src/rtl/direct.c index 817171b068..ce51b10140 100644 --- a/harbour/src/rtl/direct.c +++ b/harbour/src/rtl/direct.c @@ -140,12 +140,12 @@ HB_FUNC( DIRECTORY ) /* CA-Cl*pper compatible behavior - add all file mask when * last character is directory or drive separator */ - int iLen = ( int ) strlen( szDirSpec ) - 1; + HB_SIZE nLen = ( HB_SIZE ) strlen( szDirSpec ) - 1; #ifdef HB_OS_HAS_DRIVE_LETTER - if( szDirSpec[ iLen ] == HB_OS_PATH_DELIM_CHR || - szDirSpec[ iLen ] == HB_OS_DRIVE_DELIM_CHR ) + if( szDirSpec[ nLen ] == HB_OS_PATH_DELIM_CHR || + szDirSpec[ nLen ] == HB_OS_DRIVE_DELIM_CHR ) #else - if( szDirSpec[ iLen ] == HB_OS_PATH_DELIM_CHR ) + if( szDirSpec[ nLen ] == HB_OS_PATH_DELIM_CHR ) #endif { char * pszTemp = hb_xstrcpy( NULL, szDirSpec, HB_OS_ALLFILE_MASK, NULL ); diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index baf7f330a8..3c525cc74f 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -1919,6 +1919,12 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) AAdd( l_aOPTRUN, cParam ) ENDIF + CASE Left( cParamL, Len( "-3rd=" ) ) == "-3rd=" + + /* Silently ignore these. These options can be used to store options + processed by other tools allowing them to keep additional information + in hbmk2 script files. */ + CASE Left( cParamL, Len( "-workdir=" ) ) == "-workdir=" cWorkDir := PathSepToTarget( hbmk, PathProc( MacroProc( hbmk, ArchCompFilter( hbmk, SubStr( cParam, Len( "-workdir=" ) + 1 ) ), aParam[ _PAR_cFileName ] ), aParam[ _PAR_cFileName ] ) ) @@ -8333,6 +8339,7 @@ STATIC PROCEDURE ShowHelp( lLong ) { "-aflag=" , I_( "pass flag to linker (static library)" ) },; { "-dflag=" , I_( "pass flag to linker (dynamic library)" ) },; { "-runflag=" , I_( "pass flag to output executable when -run option is used" ) },; + { "-3rd=" , I_( "options/flags reserved for 3rd party tools, always ignore by hbmk2 itself" ) },; { "-jobs=" , I_( "start n compilation threads (multiprocess platforms only)" ) },; { "-inc" , I_( "enable incremental build mode" ) },; { "-[no]head[=]" , I_( "control source header parsing (in incremental build mode)\n can be: native (uses compiler to extract dependencies), full (uses simple text parser on the whole file), partial (default, uses simple text parser on 1st 16KB chunk of the file), off" ) },;