Fix GlogFormatterTest on Windows
[folly.git] / folly / MacAddress.cpp
index df76656a01dab1c6a02c16d37692c616f50b4e08..c182999c97bdb102d41bc9b3833836ec371d579b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
 
 #include <folly/MacAddress.h>
 
+#include <ostream>
+
 #include <folly/Exception.h>
 #include <folly/IPAddressV6.h>
 
@@ -126,7 +128,7 @@ void MacAddress::parse(StringPiece str) {
     }
 
     // Update parsed with the newly parsed byte
-    parsed[byteIndex] = ((upper << 4) | lower);
+    parsed[byteIndex] = uint8_t((upper << 4) | lower);
   }
 
   if (p != str.end()) {