diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-03 18:48:56 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-03 18:48:56 +0000 |
commit | db04b39dad59fa1ae2a15a56ac74ec1628881c65 (patch) | |
tree | 9ff1ba19c4b0498bf74e8e6c7d877773b41331bc /lib/Support/Windows/PathV2.inc | |
parent | d253545c17d5ed70fa134c02bfca9c3f85402473 (diff) |
Support/FileSystem: Fix MinGW build. It doesn't have _chsize_s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120826 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Windows/PathV2.inc')
-rw-r--r-- | lib/Support/Windows/PathV2.inc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Support/Windows/PathV2.inc b/lib/Support/Windows/PathV2.inc index da5e8b60bd..8377310388 100644 --- a/lib/Support/Windows/PathV2.inc +++ b/lib/Support/Windows/PathV2.inc @@ -310,7 +310,11 @@ error_code resize_file(const Twine &path, uint64_t size) { int fd = ::_wopen(path_utf16.begin(), O_BINARY, S_IREAD | S_IWRITE); if (fd == -1) return error_code(errno, generic_category()); +#ifdef HAVE__CHSIZE_S errno_t error = ::_chsize_s(fd, size); +#else + errno_t error = ::_chsize(fd, size); +#endif ::close(fd); return error_code(error, generic_category()); } |