From fd108f7f154874e34d0b77d4d3e846657532258c Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Wed, 24 Feb 2016 16:29:40 -0800 Subject: [PATCH] Minor MSVC issues Summary:MSVC doesn't let you have unicode characters in a narrow string without using a utf-8 literal string. AsyncTransport needs the definition of IOBuf because of how the standard library implements a few things. And longs are only 32-bit under Windows. Reviewed By: yfeldblum Differential Revision: D2973973 fb-gh-sync-id: c2f3e848e740a65c575598991d43dd79360ec1e3 shipit-source-id: c2f3e848e740a65c575598991d43dd79360ec1e3 --- folly/Fingerprint.h | 2 +- folly/io/async/AsyncTransport.h | 2 +- folly/json.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/folly/Fingerprint.h b/folly/Fingerprint.h index d46794c7..c4f6978d 100644 --- a/folly/Fingerprint.h +++ b/folly/Fingerprint.h @@ -74,7 +74,7 @@ class Fingerprint { public: Fingerprint() { // Use a non-zero starting value. We'll use (1 << (BITS-1)) - fp_[0] = 1UL << 63; + fp_[0] = 1ULL << 63; for (int i = 1; i < size(); i++) fp_[i] = 0; } diff --git a/folly/io/async/AsyncTransport.h b/folly/io/async/AsyncTransport.h index 38ee5662..8919ab34 100644 --- a/folly/io/async/AsyncTransport.h +++ b/folly/io/async/AsyncTransport.h @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -38,7 +39,6 @@ namespace folly { class AsyncSocketException; class EventBase; -class IOBuf; class SocketAddress; /* diff --git a/folly/json.cpp b/folly/json.cpp index 4fb7d04a..0d0564df 100644 --- a/folly/json.cpp +++ b/folly/json.cpp @@ -691,7 +691,7 @@ void escapeString(StringPiece input, // checking that utf8 encodings are valid char32_t v = decodeUtf8(q, e, opts.skip_invalid_utf8); if (opts.skip_invalid_utf8 && v == U'\ufffd') { - out.append("\ufffd"); + out.append(u8"\ufffd"); p = q; continue; } -- 2.34.1