Minor MSVC issues
authorChristopher Dykes <cdykes@fb.com>
Thu, 25 Feb 2016 00:29:40 +0000 (16:29 -0800)
committerfacebook-github-bot-4 <folly-bot@fb.com>
Thu, 25 Feb 2016 01:20:30 +0000 (17:20 -0800)
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
folly/io/async/AsyncTransport.h
folly/json.cpp

index d46794c79e5aa92f7a70190a57877e47e3f4fedf..c4f6978d89d33d5face3be4bbf95e7bd2204eade 100644 (file)
@@ -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;
   }
index 38ee5662fddc02915218700c778b365cc82ab73d..8919ab346f42c07df361c59daa477501a9a46727 100644 (file)
@@ -19,6 +19,7 @@
 #include <memory>
 #include <sys/uio.h>
 
+#include <folly/io/IOBuf.h>
 #include <folly/io/async/DelayedDestruction.h>
 #include <folly/io/async/EventBase.h>
 #include <folly/io/async/AsyncSocketBase.h>
@@ -38,7 +39,6 @@ namespace folly {
 
 class AsyncSocketException;
 class EventBase;
-class IOBuf;
 class SocketAddress;
 
 /*
index 4fb7d04acb131320c3100e21c20b796fb685ae49..0d0564df9b214f1931713de0f5f5b39fff7b7a08 100644 (file)
@@ -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;
         }