mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-03 14:31:10 +00:00
Use a raw_fd_ostream instead of a std::ofstream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184460 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
be87bce32b
commit
f9f44f3d5a
@ -25,7 +25,6 @@
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
using namespace llvm;
|
||||
|
||||
@ -400,9 +399,11 @@ doExtract(std::string* ErrMsg) {
|
||||
(std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) {
|
||||
|
||||
// Open up a file stream for writing
|
||||
std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
|
||||
std::ios::binary;
|
||||
std::ofstream file(I->getPath().str().c_str(), io_mode);
|
||||
std::string Err;
|
||||
raw_fd_ostream file(I->getPath().str().c_str(), Err,
|
||||
raw_fd_ostream::F_Binary);
|
||||
if (!Err.empty())
|
||||
fail(Err);
|
||||
|
||||
// Get the data and its length
|
||||
const char* data = reinterpret_cast<const char*>(I->getData());
|
||||
|
Loading…
x
Reference in New Issue
Block a user