Changeset 315 in dev


Ignore:
Timestamp:
Sep 5, 2007, 3:11:25 AM (17 years ago)
Author:
dai_9181
Message:

静的リンクライブラリの読み込みに失敗したときにコンパイルエラーメッセージを表示するようにした

Location:
trunk/abdev
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler64/MakePeHdr.cpp

    r309 r315  
    118118
    119119
     120    // 静的リンク
     121    compiler.StaticLink( compiler.staticLibraries );
     122
     123
    120124    //////////////////
    121125    // データテーブル
     
    179183    compiler.GetObjectModule().meta.GetUserProcs().Iterator_Init();
    180184    compiler.GetObjectModule().meta.GetDllProcs().Iterator_Init();
    181 
    182 /*
    183     if( !compiler.GetObjectModule().meta.WriteXml( Jenga::Common::Environment::GetAppDir() + "\\meta_test.xml" ) )
    184     {
    185         MessageBox(0,"XML書き込みに失敗","test",0);
    186     }
    187     MetaImpl *pTempMeta = new MetaImpl();
    188     if( !pTempMeta->ReadXml( Jenga::Common::Environment::GetAppDir() + "\\meta_test.xml" ) )
    189     {
    190         MessageBox(0,"XML読み込みに失敗","test",0);
    191     }
    192 
    193     if( !compiler.GetObjectModule().meta.WriteBinaly( Jenga::Common::Environment::GetAppDir() + "\\meta_test.dat" ) )
    194     {
    195         MessageBox(0,"バイナリ書き込みに失敗","test",0);
    196     }
    197     MetaImpl *pTempMeta = new MetaImpl();
    198     if( !pTempMeta->ReadBinaly( Jenga::Common::Environment::GetAppDir() + "\\meta_test.dat" ) )
    199     {
    200         MessageBox(0,"バイナリ読み込みに失敗","test",0);
    201     }
    202     if( !compiler.GetObjectModule().meta.WriteText( Jenga::Common::Environment::GetAppDir() + "\\meta_test.dat" ) )
    203     {
    204         MessageBox(0,"バイナリ書き込みに失敗","test",0);
    205     }
    206     MetaImpl *pTempMeta = new MetaImpl();
    207     if( !pTempMeta->ReadText( Jenga::Common::Environment::GetAppDir() + "\\meta_test.dat" ) )
    208     {
    209         MessageBox(0,"バイナリ読み込みに失敗","test",0);
    210     }
    211     compiler.GetObjectModule().meta = (*pTempMeta);*/
    212185
    213186
  • trunk/abdev/BasicCompiler_Common/MakeExe.cpp

    r308 r315  
    137137    // 静的リンクライブラリをロードする
    138138    /////////////////////////////////////////////////////////////////
    139 
    140     if( !compiler.IsCore() )
    141139    {
    142         // コアモジュールをロードする
    143         extern BOOL bDebugCompile;
    144         extern char szIncludeDir[MAX_PATH];
    145 
    146         const char *coreFileName = "core.lib";
    147         if( bDebugCompile )
     140        bool isSuccessfulLoadStaticLinkLibrary = true;
     141        if( !compiler.IsCore() )
    148142        {
    149             coreFileName = "cored.lib";
    150         }
    151 
    152         char coreFilePath[MAX_PATH];
     143            // コアモジュールをロードする
     144            extern BOOL bDebugCompile;
     145            extern char szIncludeDir[MAX_PATH];
     146
     147            const char *coreFileName = "core.lib";
     148            if( bDebugCompile )
     149            {
     150                coreFileName = "cored.lib";
     151            }
     152
     153            char coreFilePath[MAX_PATH];
    153154#ifdef _AMD64_
    154         sprintf( coreFilePath, "..\\lib\\x64\\%s", coreFileName );
     155            sprintf( coreFilePath, "..\\lib\\x64\\%s", coreFileName );
    155156#else
    156         sprintf( coreFilePath, "..\\lib\\%s", coreFileName );
     157            sprintf( coreFilePath, "..\\lib\\%s", coreFileName );
    157158#endif
    158         GetFullPath( coreFilePath, szIncludeDir );
    159 
    160         compiler.staticLibraries.push_back( new ObjectModule() );
    161         compiler.staticLibraries.back()->Read( coreFilePath );
    162 
    163         Jenga::Common::Path path( coreFilePath );
    164         CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" を読み込みました。").c_str() );
    165     }
    166 
    167     BOOST_FOREACH( const std::string &filePath, compiler.staticLibraryFilePaths )
    168     {
    169         compiler.staticLibraries.push_back( new ObjectModule() );
    170         compiler.staticLibraries.back()->Read( filePath );
    171 
    172         Jenga::Common::Path path( filePath );
    173         CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" を読み込みました。").c_str() );
     159            GetFullPath( coreFilePath, szIncludeDir );
     160
     161            Jenga::Common::Path path( coreFilePath );
     162            if( path.IsExistFile() )
     163            {
     164                compiler.staticLibraries.push_back( new ObjectModule() );
     165                if( compiler.staticLibraries.back()->Read( coreFilePath ) )
     166                {
     167                    CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" を読み込みました。").c_str() );
     168                }
     169                else
     170                {
     171                    CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが壊れています。").c_str() );
     172                    isSuccessfulLoadStaticLinkLibrary = false;
     173                }
     174            }
     175            else
     176            {
     177                CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが存在しません。").c_str() );
     178                isSuccessfulLoadStaticLinkLibrary = false;
     179            }
     180        }
     181
     182        BOOST_FOREACH( const std::string &filePath, compiler.staticLibraryFilePaths )
     183        {
     184            Jenga::Common::Path path( filePath );
     185            if( path.IsExistFile() )
     186            {
     187                compiler.staticLibraries.push_back( new ObjectModule() );
     188                if( compiler.staticLibraries.back()->Read( filePath ) )
     189                {
     190                    CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" を読み込みました。").c_str() );
     191                }
     192                else
     193                {
     194                    CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが壊れています。").c_str() );
     195                    isSuccessfulLoadStaticLinkLibrary = false;
     196                }
     197            }
     198            else
     199            {
     200                CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが存在しません。").c_str() );
     201                isSuccessfulLoadStaticLinkLibrary = false;
     202            }
     203        }
     204
     205        if( !isSuccessfulLoadStaticLinkLibrary )
     206        {
     207            // 静的リンクライブラリのロードに失敗したとき
     208            goto EndCompile;
     209        }
    174210    }
    175211
Note: See TracChangeset for help on using the changeset viewer.