Ignore:
Timestamp:
Mar 24, 2008, 8:05:20 PM (16 years ago)
Author:
dai_9181
Message:

Messenger/ErrorMessengerクラスを導入。SetError関数によるエラー生成を廃止した。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler32/MakePeHdr.cpp

    r459 r465  
    365365        // 名前空間が初期化されているかをチェック
    366366        if( compiler.GetNamespaceSupporter().GetLivingNamespaceScopes().size() ){
    367             SetError();
     367            compiler.errorMessenger.OutputFatalError();
    368368        }
    369369
     
    443443        //With情報のメモリを解放
    444444        for(i=0;i<WithInfo.num;i++){
    445             SetError(22,"With",WithInfo.pWithCp[i]);
     445            compiler.errorMessenger.Output(22,"With",WithInfo.pWithCp[i]);
    446446            HeapDefaultFree(WithInfo.ppName[i]);
    447447        }
     
    451451        // 名前空間が正しく閉じられているかをチェック
    452452        if( compiler.GetNamespaceSupporter().GetLivingNamespaceScopes().size() ){
    453             SetError(63,NULL,-1);
     453            compiler.errorMessenger.Output(63,NULL,-1);
    454454        }
    455455
     
    504504    }
    505505
    506     extern BOOL bError;
    507     if( !bError )
     506    if( !compiler.errorMessenger.HasError() )
    508507    {
    509         CompileMessage( "リンク中..." );
     508        compiler.messenger.Output( "リンク中..." );
    510509    }
    511510
     
    558557
    559558            if(!hLib){
    560                 SetError(-106,pDllProc->GetDllFileName().c_str(),pDllProc->GetCodePos());
     559                compiler.errorMessenger.Output(-106,pDllProc->GetDllFileName().c_str(),pDllProc->GetCodePos());
    561560            }
    562561        }
     
    565564            if(!GetProcAddress(hLib,pDllProc->GetAlias().c_str())){
    566565                FreeLibrary(hLib);
    567                 SetError(-107,pDllProc->GetAlias(),pDllProc->GetCodePos());
     566                compiler.errorMessenger.Output(-107,pDllProc->GetAlias(),pDllProc->GetCodePos());
    568567            }
    569568            FreeLibrary(hLib);
     
    712711
    713712        if( pDllProc->GetDllFileName().size() > 16 ){
    714             SetError(7,NULL,cp);
     713            compiler.errorMessenger.Output(7,NULL,cp);
    715714            break;
    716715        }
     
    831830    CDebugSection *pobj_DebugSection;
    832831    pobj_DebugSection=new CDebugSection();
    833     extern BOOL bError;
    834     if( compiler.IsDebug() && bError == 0 )
     832    if( compiler.IsDebug() && !compiler.errorMessenger.HasError() )
    835833    {
    836         CompileMessage( "デバッグ情報を生成しています。" );
     834        compiler.messenger.Output( "デバッグ情報を生成しています。" );
    837835
    838836        pobj_DebugSection->make();
    839837
    840         CompileMessage( "デバッグ情報の生成が完了しました。" );
     838        compiler.messenger.Output( "デバッグ情報の生成が完了しました。" );
    841839    }
    842840
     
    11221120
    11231121
    1124     extern BOOL bError;
    1125     if(bError) goto EndWriteOpcode;
     1122    if( compiler.errorMessenger.HasError() )
     1123    {
     1124        goto EndWriteOpcode;
     1125    }
    11261126
    11271127
     
    14141414    hFile=CreateFile(OutputFileName,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
    14151415    if(hFile==INVALID_HANDLE_VALUE){
    1416         SetError(53,OutputFileName,-1);
     1416        compiler.errorMessenger.Output(53,OutputFileName,-1);
    14171417        goto EndWriteOpcode;
    14181418    }
Note: See TracChangeset for help on using the changeset viewer.