From b35d519bd3982e923362add3d2ddffae4819eefe Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Fri, 21 Jan 2000 15:01:27 +0000 Subject: [PATCH] Updating hbpp.c --- harbour/ChangeLog | 4 ++++ harbour/source/pp/hbpp.c | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 447e901409..c01dd19f59 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +20000121-17:57 GMT+3 Alexander Kresin + * source/pp/hbpp.c + * now can be used truncated preprocessor directives ( #defi, #inclu, ... ) + 20000121-12:50 GMT+1 Ignacio Ortiz + source/rtl/mlpos.c * Added function MlPos() diff --git a/harbour/source/pp/hbpp.c b/harbour/source/pp/hbpp.c index 120917ceee..c57fb7788d 100644 --- a/harbour/source/pp/hbpp.c +++ b/harbour/source/pp/hbpp.c @@ -197,22 +197,22 @@ int hb_pp_ParseDirective( char * sLine ) hb_pp_aCondCompile[hb_pp_nCondCompile-1] = 1 - hb_pp_aCondCompile[hb_pp_nCondCompile-1]; } - else if( i == 5 && memcmp( sDirective, "ENDIF", 5 ) == 0 ) + else if( i >= 4 && i <= 5 && memcmp( sDirective, "ENDIF", i ) == 0 ) { /* --- #endif --- */ if( hb_pp_nCondCompile == 0 ) hb_compGenError( hb_pp_szErrors, 'F', ERR_DIRECTIVE_ENDIF, NULL, NULL ); else hb_pp_nCondCompile--; } - else if( i == 5 && memcmp( sDirective, "IFDEF", 5 ) == 0 ) + else if( i >= 4 && i <= 5 && memcmp( sDirective, "IFDEF", i ) == 0 ) ParseIfdef( sLine, TRUE ); /* --- #ifdef --- */ - else if( i == 6 && memcmp( sDirective, "IFNDEF", 6 ) == 0 ) + else if( i >= 4 && i <= 6 && memcmp( sDirective, "IFNDEF", i ) == 0 ) ParseIfdef( sLine, FALSE ); /* --- #ifndef --- */ else if( hb_pp_nCondCompile==0 || hb_pp_aCondCompile[hb_pp_nCondCompile-1]) { - if( i == 7 && memcmp( sDirective, "INCLUDE", 7 ) == 0 ) + if( i >= 4 && i <= 7 && memcmp( sDirective, "INCLUDE", i ) == 0 ) { /* --- #include --- */ char cDelimChar; @@ -243,26 +243,26 @@ int hb_pp_ParseDirective( char * sLine ) hb_compGenError( hb_pp_szErrors, 'F', ERR_CANNOT_OPEN, sLine, NULL ); } - else if( i == 6 && memcmp( sDirective, "DEFINE", 6 ) == 0 ) + else if( i >= 4 && i <= 6 && memcmp( sDirective, "DEFINE", i ) == 0 ) ParseDefine( sLine ); /* --- #define --- */ - else if( i == 5 && memcmp( sDirective, "UNDEF", 5 ) == 0 ) + else if( i >= 4 && i <= 5 && memcmp( sDirective, "UNDEF", i ) == 0 ) ParseUndef( sLine ); /* --- #undef --- */ - else if( (i == 7 && memcmp( sDirective, "COMMAND", 7 ) == 0) || - (i == 8 && memcmp( sDirective, "XCOMMAND", 8 ) == 0) ) + else if( (i >= 4 && i <= 7 && memcmp( sDirective, "COMMAND", i ) == 0) || + (i >= 4 && i <= 8 && memcmp( sDirective, "XCOMMAND", i ) == 0) ) /* --- #command --- */ ParseCommand( sLine, (i==7)? FALSE:TRUE, TRUE ); - else if( (i == 9 && memcmp( sDirective, "TRANSLATE", 9 ) == 0) || - (i == 10 && memcmp( sDirective, "XTRANSLATE", 10 ) == 0) ) + else if( (i >= 4 && i <= 9 && memcmp( sDirective, "TRANSLATE", i ) == 0) || + (i >= 4 && i <= 10 && memcmp( sDirective, "XTRANSLATE", i ) == 0) ) /* --- #translate --- */ ParseCommand( sLine, (i==9)? FALSE:TRUE, FALSE ); - else if( i == 6 && memcmp( sDirective, "STDOUT", 6 ) == 0 ) + else if( i >= 4 && i <= 6 && memcmp( sDirective, "STDOUT", i ) == 0 ) printf( "%s\n", sLine ); /* --- #stdout --- */ - else if( i == 5 && memcmp( sDirective, "ERROR", 5 ) == 0 ) + else if( i >= 4 && i <= 5 && memcmp( sDirective, "ERROR", i ) == 0 ) /* --- #error --- */ hb_compGenError( hb_pp_szErrors, 'E', ERR_EXPLICIT, sLine, NULL );