From ffc409c4cdcb5c29991372e7c5478863350c38e8 Mon Sep 17 00:00:00 2001 From: Andrew Krieger Date: Wed, 28 Jun 2017 17:12:01 -0700 Subject: [PATCH] Remove dependency on Conv.h from FileUtil.h Summary: So we can use writeFile in projects which compile with -fno-rtti Reviewed By: mzlee Differential Revision: D5341469 fbshipit-source-id: bb77baf9576604ff862d54d59bf382862bd0dd58 --- folly/FileUtil.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/folly/FileUtil.h b/folly/FileUtil.h index 7386b934..d3260f91 100644 --- a/folly/FileUtil.h +++ b/folly/FileUtil.h @@ -16,8 +16,8 @@ #pragma once -#include #include +#include #include #include #include @@ -139,8 +139,7 @@ bool readFile( constexpr size_t initialAlloc = 1024 * 4; out.resize( std::min( - buf.st_size > 0 ? folly::to(buf.st_size + 1) : initialAlloc, - num_bytes)); + buf.st_size > 0 ? (size_t(buf.st_size) + 1) : initialAlloc, num_bytes)); while (soFar < out.size()) { const auto actual = readFull(fd, &out[soFar], out.size() - soFar); -- 2.34.1