summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Windows
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-03 18:48:56 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-03 18:48:56 +0000
commitca242f2c366a02d108ae846637614800c1932fca (patch)
tree2840fa69192cf7a880adf7efe01d762ac267f4fc /llvm/lib/Support/Windows
parentf8da863196a173ed90c627e468d42381bf48675d (diff)
downloadbcm5719-llvm-ca242f2c366a02d108ae846637614800c1932fca.tar.gz
bcm5719-llvm-ca242f2c366a02d108ae846637614800c1932fca.zip
Support/FileSystem: Fix MinGW build. It doesn't have _chsize_s.
llvm-svn: 120826
Diffstat (limited to 'llvm/lib/Support/Windows')
-rw-r--r--llvm/lib/Support/Windows/PathV2.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Support/Windows/PathV2.inc b/llvm/lib/Support/Windows/PathV2.inc
index da5e8b60bd0..8377310388c 100644
--- a/llvm/lib/Support/Windows/PathV2.inc
+++ b/llvm/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());
}
OpenPOWER on IntegriCloud