Changeset 69 in dev for BasicCompiler_Common/preprocessor.cpp
- Timestamp:
- Mar 13, 2007, 4:52:59 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/preprocessor.cpp
r68 r69 26 26 free( ppFilePath ); 27 27 } 28 bool IsIncluded( const char *FilePath ){ 29 for( int i = 0; i < count; i++ ){ 30 if( lstrcmpi( ppFilePath[i], FilePath ) == 0 ){ 28 bool IsIncluded( const char *includeFilePath ){ 29 // '/' → '\\' 30 char tempPath[MAX_PATH]; 31 lstrcpy( tempPath, includeFilePath ); 32 for( int i=0; tempPath[i]; i++ ){ 33 if( tempPath[i] == '/' ){ 34 tempPath[i] = '\\'; 35 } 36 } 37 38 for( int i=0; i<count; i++ ){ 39 if( lstrcmpi( ppFilePath[i], tempPath ) == 0 ){ 31 40 return true; 32 41 } … … 34 43 return false; 35 44 } 36 void Add( const char *FilePath ){ 45 void Add( const char *includeFilePath ){ 46 // '/' → '\\' 47 char tempPath[MAX_PATH]; 48 lstrcpy( tempPath, includeFilePath ); 49 for( int i=0; tempPath[i]; i++ ){ 50 if( tempPath[i] == '/' ){ 51 tempPath[i] = '\\'; 52 } 53 } 54 37 55 //既に読み込まれているとき 38 if( IsIncluded( FilePath ) ) return;56 if( IsIncluded( tempPath ) ) return; 39 57 40 58 //追加 41 59 ppFilePath = (char **)realloc(ppFilePath, ( count + 1 ) * sizeof(char *) ); 42 ppFilePath[count] = (char *)malloc( lstrlen( FilePath) + 1 );43 lstrcpy( ppFilePath[count], FilePath );60 ppFilePath[count] = (char *)malloc( lstrlen(tempPath) + 1 ); 61 lstrcpy( ppFilePath[count], tempPath ); 44 62 count++; 45 63 } … … 84 102 } 85 103 86 // TODO: 削除87 add( "__STRING_IS_NOT_ALWAYS_UNICODE" );88 89 104 char temporary[255]; 90 105 sprintf(temporary,"_AB_VER%d",MAJOR_VER);
Note:
See TracChangeset
for help on using the changeset viewer.