Commit 1e7f9f89 authored by TJ Yin's avatar TJ Yin Committed by Facebook GitHub Bot

fix file_util in windows

Summary:
For MSVC, `ssize_t` and `std::make_signed_t<std::size_t>` are different types (even though both are 32 bit signed integer, `std::is_same` is false: https://godbolt.org/z/n4Wfbh3nM). This creates type mismatch between header and cpp file.

This diff changed to include `folly/portability/SysTypes.h` which defines `ssize_t` in a portable way.

Reviewed By: ot

Differential Revision: D31722673

fbshipit-source-id: c8968d5e0b5ac12d8d6ab4c141f791cb73d80686
parent 5cfeab7b
......@@ -20,6 +20,8 @@
#include <cstddef>
#include <type_traits>
#include <folly/portability/SysTypes.h>
// Private functions for wrapping file-io against interrupt and partial op
// completions.
//
......@@ -30,8 +32,6 @@
namespace folly {
namespace fileutil_detail {
using ssize_t = std::make_signed_t<size_t>;
// Wrap call to f(args) in loop to retry on EINTR
template <class F, class... Args>
ssize_t wrapNoInt(F f, Args... args) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment