Example #1
0
MSwitch* WEXPORT MTool::findSwitch( WString& switchtag, long fixed_version )
{
    //
    // Open Watcom IDE configuration/project files are buggy
    // There are many switch ID's which were changed by incompatible way
    // IDE uses various hacks to fix it later instead of proper solution
    // It is very hard to detect what was broken in each OW version because
    // there vere no change to version number of project files
    //
    if( fixed_version != 0 && fixed_version < 41 && _config->version() < 5 ) {
        //
        // hack for buggy version of configuration/project files
        //
        FixTypo( switchtag );
    }
    int icount = _families.count();
    for( int i = 0; i < icount; i++ ) {
        MFamily* family = (MFamily*)_families[i];
        MSwitch* sw = family->findSwitch( this, switchtag, fixed_version );
        if( sw != NULL ) {
            return( sw );
        }
    }
    icount = _incTools.count();
    for( int i = 0; i < icount; i++ ) {
        MTool* tool = (MTool*)_incTools[i];
        MSwitch* sw = tool->findSwitch( switchtag, fixed_version );
        if( sw != NULL ) {
            return( sw );
        }
    }
    return( NULL );
}
Example #2
0
void WEXPORT MState::readSelf( WObjectFile& p )
{
    p.readObject( &_toolTag );
    _tool = _config->findTool( _toolTag );
    if( !_tool ) {
        MRule* r = _config->findRule( _toolTag );       //temp
        if( r ) {
            _tool = r->tool();
        } else {
            _tool = _config->nilTool();
        }
        _toolTag = _tool->tag();
    }
    p.readObject( &_switchTag );
    _config->kludgeString( _switchTag );
    FixTypo( _switchTag );
    _switch = _tool->findSwitch( _switchTag );
    if( p.version() > 27 ) {
        p.readObject( &_mode );
    }
}