diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-06-29 15:54:41 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-06-29 15:54:41 +0800 |
commit | 64af65a27097e17811c943dbac551ae741413954 (patch) | |
tree | 1ae96ce8b87ab54f03e06b47cca6b7981c43f7f6 /src/ast/crate.cpp | |
parent | 97763cebbdbe016a694840cc296c76b65576aa57 (diff) | |
download | mrust-64af65a27097e17811c943dbac551ae741413954.tar.gz |
Trans - Rework to potentially support dynamic libraries
Diffstat (limited to 'src/ast/crate.cpp')
-rw-r--r-- | src/ast/crate.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ast/crate.cpp b/src/ast/crate.cpp index 6abe6d59..8743ae2b 100644 --- a/src/ast/crate.cpp +++ b/src/ast/crate.cpp @@ -146,7 +146,7 @@ RcString Crate::load_extern_crate(Span sp, const RcString& name, const ::std::st else { ::std::vector<::std::string> paths; - auto direct_filename = FMT("lib" << name.c_str() << ".hir"); + auto direct_filename = FMT("lib" << name.c_str() << ".rlib"); auto name_prefix = FMT("lib" << name.c_str() << "-"); // Search a list of load paths for the crate for(const auto& p : g_crate_load_dirs) @@ -158,7 +158,7 @@ RcString Crate::load_extern_crate(Span sp, const RcString& name, const ::std::st } path = ""; - // Search for `p+"/lib"+name+"-*.hir" (which would match e.g. libnum-0.11.hir) + // Search for `p+"/lib"+name+"-*.rlib" (which would match e.g. libnum-0.11.rlib) auto dp = opendir(p.c_str()); if( !dp ) { continue ; @@ -168,11 +168,11 @@ RcString Crate::load_extern_crate(Span sp, const RcString& name, const ::std::st { // AND the start is "lib"+name size_t len = strlen(ent->d_name); - if( len <= 4 || strcmp(ent->d_name + len - 4, ".hir") != 0 ) + if( len <= 5 || strcmp(ent->d_name + len - 5, ".rlib") != 0 ) continue ; DEBUG(ent->d_name << " vs " << name_prefix); - // Check if the entry ends with .hir + // Check if the entry ends with .rlib if( strncmp(name_prefix.c_str(), ent->d_name, name_prefix.size()) != 0 ) continue ; |