Changeset 554 in dev


Ignore:
Timestamp:
May 5, 2008, 1:23:46 AM (16 years ago)
Author:
dai_9181
Message:

CDefine::Initメソッドで使用するCompilerクラス依存のフラグを外部から引き渡すようにした。

Location:
trunk/ab5.0/abdev/BasicCompiler_Common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp

    r545 r554  
    44
    55#include "common.h"
     6#include <ver.h>
    67
    78void StepCompileProgress(void){
     
    6566    compiler.GetObjectModule().SetCurrentSourceIndex( (int)compiler.GetObjectModule().GetSources().size() );
    6667    compiler.GetObjectModule().GetSources().push_back( BasicSource() );
    67     if( !compiler.GetObjectModule().GetCurrentSource().ReadFile( program.GetSourceFilePath() ) ){
     68    bool result = compiler.GetObjectModule().GetCurrentSource().ReadFile(
     69        program.GetSourceFilePath(),
     70        compiler.IsDebug(),
     71        compiler.IsDll(),
     72        compiler.IsUnicode(),
     73        MAJOR_VER
     74    );
     75    if( !result ){
    6876        compiler.errorMessenger.Output(201,program.GetSourceFilePath(),-1);
    6977        goto EndCompile;
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Source.h

    r553 r554  
    229229    void SetBuffer( const char *buffer );
    230230
    231     bool ReadFile( const std::string &filePath );
     231    bool ReadFile( const std::string &filePath, bool isDebug, bool isDll, bool isUnicode, int majorVer );
    232232
    233233    void Addition( const char *buffer );
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Source.cpp

    r553 r554  
    77    std::vector<std::string> names;
    88public:
    9     CDefine( int majorVer );
    10     ~CDefine();
    119    void Free();
    12     void Init( int majorVer );
     10    void Init( bool isDebug, bool isDll, bool isUnicode, int majorVer );
    1311
    1412    BOOL add(char *name);
     
    1816    void DirectiveIfdef(char *buffer);
    1917};
    20 // TODO: バージョン番号の識別子defineが未完成
    21 CDefine objDefine(0);
     18CDefine objDefine;
    2219
    2320
     
    9289//////////////////////////////////////
    9390
    94 CDefine::CDefine( int majorVer )
    95 {
    96     Init( majorVer );
    97 }
    98 CDefine::~CDefine()
    99 {
    100 }
    101 void CDefine::Init( int majorVer )
     91void CDefine::Init( bool isDebug, bool isDll, bool isUnicode, int majorVer )
    10292{
    10393    names.clear();
    10494
    105     if( compiler.IsDebug() )
     95    if( isDebug )
    10696    {
    10797        add("_DEBUG");
     
    112102#endif
    113103
    114     if( compiler.IsDll() )
     104    if( isDll )
    115105    {
    116106        add("_DLL");
    117107    }
    118108
    119     if( compiler.IsUnicode() )
     109    if( isUnicode )
    120110    {
    121111        add( "UNICODE" );
     
    854844}
    855845
    856 bool BasicSource::ReadFile( const std::string &filePath ){
     846bool BasicSource::ReadFile( const std::string &filePath, bool isDebug, bool isDll, bool isUnicode, int majorVer ){
    857847    if( !Text::ReadFile( filePath ) ){
    858848        return false;
     
    871861    // #defineと#requireを初期化
    872862    // TODO: バージョン番号の識別子defineが未完成
    873     objDefine.Init(0);
     863    objDefine.Init( isDebug, isDll, isUnicode, majorVer );
    874864    requireFiles.clear();
    875865
Note: See TracChangeset for help on using the changeset viewer.