Displaying 1 result from an estimated 1 matches for "archivemagic".
2003 May 22
1
[LLVMdev] allow gcc .... /full/path/to/libfoo.a
...yObject(c
return M.release();
}
+// IsArchive - Returns true iff FILENAME appears to be the name of an ar
+// archive file. It determines this by checking the magic string at the
+// beginning of the file.
+static bool IsArchive (const std::string &filename) {
+ static const std::string ArchiveMagic ("!<arch>\012");
+ char buf[1 + ArchiveMagic.size ()];
+ std::ifstream f (filename.c_str ());
+ f.read (buf, ArchiveMagic.size ());
+ buf[ArchiveMagic.size ()] = '\0';
+ return (ArchiveMagic == buf);
+}
-// LoadLibraryFromDirectory - This looks for a .a, .so, or .bc f...