Fix the size of the enum in FBString.h under MSVC
authorOrvid King <blah38621@gmail.com>
Mon, 27 Jul 2015 22:17:32 +0000 (15:17 -0700)
committerfacebook-github-bot-4 <folly-bot@fb.com>
Mon, 27 Jul 2015 23:22:20 +0000 (16:22 -0700)
Summary: MSVC defaults enum sizes to int, so explicitly use `size_t` as the base to have it correctly sized.
Closes #246

Reviewed By: @yfeldblum

Differential Revision: D2282816

Pulled By: @sgolemon

folly/FBString.h

index c43460a2a5fb13632fffcea9d7475ba8162b51e1..53ade9b7adad45e333f3f26bb639436974c143aa 100644 (file)
@@ -810,7 +810,7 @@ private:
     MediumLarge ml_;
   };
 
-  enum {
+  enum : size_t {
     lastChar = sizeof(MediumLarge) - 1,
     maxSmallSize = lastChar / sizeof(Char),
     maxMediumSize = 254 / sizeof(Char),            // coincides with the small