Changeset 67 in dev for BasicCompiler_Common/preprocessor.cpp
- Timestamp:
- Mar 11, 2007, 3:25:42 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/preprocessor.cpp
r55 r67 142 142 CDefine *pobj_define; 143 143 144 int Search_endif(char *buffer,int i ){144 int Search_endif(char *buffer,int i, int *pLine = 0){ 145 145 for(;;i++){ 146 146 if(buffer[i]=='\0') break; 147 147 148 if( buffer[i] == '\n' ){ 149 if( pLine ){ 150 (*pLine)++; 151 } 152 } 153 148 154 if(buffer[i-1]=='\n'){ 149 155 if(_memicmp(buffer+i,"#ifdef",6)==0||_memicmp(buffer+i,"#ifndef",7)==0){ 150 i=Search_endif(buffer,i+6 );156 i=Search_endif(buffer,i+6, pLine); 151 157 if(buffer[i]=='\0') break; 152 158 continue; … … 229 235 if(i2==0||buffer[i2-1]=='\n'){ 230 236 if(_memicmp(buffer+i2,"#ifdef",6)==0||_memicmp(buffer+i2,"#ifndef",7)==0){ 231 i2=Search_endif(buffer,i2+6 );237 i2=Search_endif(buffer,i2+6, &i3 ); 232 238 if(buffer[i2]=='\0') break; 233 239 continue; … … 256 262 if(i2==0||buffer[i2-1]=='\n'){ 257 263 if(_memicmp(buffer+i2,"#ifdef",6)==0||_memicmp(buffer+i2,"#ifndef",7)==0){ 258 i2=Search_endif(buffer,i2+6 );264 i2=Search_endif(buffer,i2+6, &i3 ); 259 265 if(buffer[i2]=='\0') break; 260 266 continue;
Note:
See TracChangeset
for help on using the changeset viewer.