Fix loading of module for borland

This commit is contained in:
Andy Cedilnik 2002-09-23 13:11:39 -04:00
parent 6a096be924
commit 5843ae455e

View File

@ -196,9 +196,21 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& argsIn)
CM_NAME_FUNCTION nameFunction CM_NAME_FUNCTION nameFunction
= (CM_NAME_FUNCTION) = (CM_NAME_FUNCTION)
cmDynamicLoader::GetSymbolAddress(lib, "cmGetName"); cmDynamicLoader::GetSymbolAddress(lib, "cmGetName");
if ( !nameFunction )
{
nameFunction =
(CM_NAME_FUNCTION)(
cmDynamicLoader::GetSymbolAddress(lib, "_cmGetName"));
}
CM_INIT_FUNCTION initFunction CM_INIT_FUNCTION initFunction
= (CM_INIT_FUNCTION) = (CM_INIT_FUNCTION)
cmDynamicLoader::GetSymbolAddress(lib, "cmInitializeCommand"); cmDynamicLoader::GetSymbolAddress(lib, "cmInitializeCommand");
if ( !initFunction )
{
initFunction =
(CM_INIT_FUNCTION)(
cmDynamicLoader::GetSymbolAddress(lib, "_cmInitializeCommand"));
}
// if the symbol is found call it to set the name on the // if the symbol is found call it to set the name on the
// function blocker // function blocker
if(nameFunction) if(nameFunction)
@ -208,13 +220,15 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& argsIn)
f->m_commandName = (*nameFunction)(); f->m_commandName = (*nameFunction)();
if (!initFunction) if (!initFunction)
{ {
this->SetError("Attempt to load command failed. No init function found."); this->SetError("Attempt to load command failed. "
"No init function found.");
return false; return false;
} }
(*initFunction)(&f->info); (*initFunction)(&f->info);
m_Makefile->AddCommand(f); m_Makefile->AddCommand(f);
}
}
return true; return true;
}
}
return false;
} }