Пример #1
0
 StartupInfoEx( LPSTARTUPINFOW si, StringSaver<wchar_t> & saver )
 {
     static_cast<STARTUPINFOW &>( *this ) = *si;
     lpReserved = saver.save( lpReserved );
     lpDesktop = saver.save( lpDesktop );
     lpTitle = saver.save( lpTitle );
 }
Пример #2
0
static std::vector<StringRef> getSearchPaths(opt::InputArgList *Args,
                                             StringSaver &Saver) {
  std::vector<StringRef> Ret;
  // Add current directory as first item of the search path.
  Ret.push_back("");

  // Add /libpath flags.
  for (auto *Arg : Args->filtered(OPT_libpath))
    Ret.push_back(Arg->getValue());

  // Add $LIB.
  Optional<std::string> EnvOpt = sys::Process::GetEnv("LIB");
  if (!EnvOpt.hasValue())
    return Ret;
  StringRef Env = Saver.save(*EnvOpt);
  while (!Env.empty()) {
    StringRef Path;
    std::tie(Path, Env) = Env.split(';');
    Ret.push_back(Path);
  }
  return Ret;
}