folly/portability/Constexpr.h: add missing include statement
authorSven Over <over@fb.com>
Mon, 14 Mar 2016 18:43:33 +0000 (11:43 -0700)
committerFacebook Github Bot 7 <facebook-github-bot-7-bot@fb.com>
Mon, 14 Mar 2016 18:50:22 +0000 (11:50 -0700)
Summary:This commit fixes compiler errors when Constexpr.h was included
on gcc before cstring (or string.h) was included. Also, qualify
the call to strlen with the std namespace.

Reviewed By: yfeldblum

Differential Revision: D3047417

fb-gh-sync-id: 7a50dac2e9449b149062896f34fa5e864f767943
shipit-source-id: 7a50dac2e9449b149062896f34fa5e864f767943

folly/portability/Constexpr.h

index 810f987a70865abb000f923453ab799fe90a1da8..7ea46300491057d5fdddbdd95fa1c4ba2e4dab28 100755 (executable)
@@ -18,6 +18,7 @@
 #define FOLLY_CONSTEXPR_H_
 
 #include <cstdint>
+#include <cstring>
 
 namespace folly {
 
@@ -45,7 +46,7 @@ constexpr size_t constexpr_strlen(const char* s) {
 #elif defined(_MSC_VER)
   return s == nullptr ? 0 : constexpr_strlen_internal(s, 0);
 #else
-  return strlen(s);
+  return std::strlen(s);
 #endif
 }
 }