diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 4fd8d21408..62a538c3d4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,13 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-06-05 13:42 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/pp/hbppgen.c + + added -d[=] command line switch + + * harbour/source/compiler/cmdcheck.c + * cleaned processing -d[=] switches + 2008-06-05 12:57 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/bin/hb-func.sh + added get_hbverstat function to extract build status from hbver.h diff --git a/harbour/source/compiler/cmdcheck.c b/harbour/source/compiler/cmdcheck.c index 06cce35957..48e8e043ab 100644 --- a/harbour/source/compiler/cmdcheck.c +++ b/harbour/source/compiler/cmdcheck.c @@ -1004,21 +1004,16 @@ static void hb_compChkDefineSwitch( HB_COMP_DECL, char *pszSwitch ) { if( pszSwitch[1] == 'd' || pszSwitch[1] == 'D' ) { - char *szDefText = hb_strdup( pszSwitch + 2 ), *pAssign; - unsigned int i = 0; - - while( szDefText[i] /*&& !HB_ISOPTSEP( szDefText[i] )*/ ) - i++; - - szDefText[i] = '\0'; - if( szDefText ) + if( pszSwitch[2] ) { - pAssign = strchr( szDefText, '=' ); - if( pAssign ) - *pAssign++ = '\0'; - hb_pp_addDefine( HB_COMP_PARAM->pLex->pPP, szDefText, pAssign ); + char *szDefText = hb_strdup( pszSwitch + 2 ), *szAssign; + + szAssign = strchr( szDefText, '=' ); + if( szAssign ) + *szAssign++ = '\0'; + hb_pp_addDefine( HB_COMP_PARAM->pLex->pPP, szDefText, szAssign ); + hb_xfree( szDefText ); } - hb_xfree( szDefText ); } else if( pszSwitch[1] && toupper( pszSwitch[1] ) == 'U' && pszSwitch[2] && toupper( pszSwitch[2] ) == 'N' && diff --git a/harbour/source/pp/hbppgen.c b/harbour/source/pp/hbppgen.c index f730cdf115..d5585590bb 100644 --- a/harbour/source/pp/hbppgen.c +++ b/harbour/source/pp/hbppgen.c @@ -498,12 +498,13 @@ static void hb_pp_usage( char * szName ) { printf( "\n" ); printf( "Syntax: %s [options]\n\n", szName ); - printf( "Options: -i \tadd #include file search path\n" - " -c[]\tlook for ChangeLog file\n" - " -o \tcreates .c file with PP rules\n" - " -v \tcreates .h file with version information\n" - " -w \twrite preprocessed (.ppo) input file\n" - " -q \tdisable information messages\n" ); + printf( "Options: -d[=]\t#define \n" + " -i \tadd #include file search path\n" + " -c[] \tlook for ChangeLog file\n" + " -o \tcreates .c file with PP rules\n" + " -v \tcreates .h file with version information\n" + " -w \twrite preprocessed (.ppo) input file\n" + " -q \tdisable information messages\n" ); } int main( int argc, char * argv[] ) @@ -540,6 +541,22 @@ int main( int argc, char * argv[] ) fQuiet = TRUE; break; + case 'd': + case 'D': + if( !argv[i][2] ) + szFile = NULL; + else + { + char *szDefText = hb_strdup( argv[i] + 2 ), *szAssign; + + szAssign = strchr( szDefText, '=' ); + if( szAssign ) + *szAssign++ = '\0'; + hb_pp_addDefine( pState, szDefText, szAssign ); + hb_xfree( szDefText ); + } + break; + case 'w': case 'W': if( argv[i][2] )