From: Giuseppe Ottaviano Date: Thu, 12 Nov 2015 16:37:14 +0000 (-0800) Subject: Disable assertions in FBString when used as std::string X-Git-Tag: deprecate-dynamic-initializer~258 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=a348e154aa2822c13590526d6558e37bda2cdc2b Disable assertions in FBString when used as std::string Reviewed By: Gownta Differential Revision: D2643850 fb-gh-sync-id: 2c4bb844ea2006215b0637cb1ba08c636faefe05 --- diff --git a/folly/FBString.h b/folly/FBString.h index d8dccd80..f7b58ccc 100644 --- a/folly/FBString.h +++ b/folly/FBString.h @@ -32,6 +32,12 @@ #pragma GCC system_header +// When used as std::string replacement always disable assertions. +#ifndef NDEBUG +#define NDEBUG +#define FOLLY_DEFINED_NDEBUG_FOR_FBSTRING +#endif // NDEBUG + // Handle the cases where the fbcode version (folly/Malloc.h) is included // either before or after this inclusion. #ifdef FOLLY_MALLOC_H_ @@ -2553,4 +2559,9 @@ FOLLY_FBSTRING_HASH #undef FBSTRING_LIKELY #undef FBSTRING_UNLIKELY +#ifdef FOLLY_DEFINED_NDEBUG_FOR_FBSTRING +#undef NDEBUG +#undef FOLLY_DEFINED_NDEBUG_FOR_FBSTRING +#endif // FOLLY_DEFINED_NDEBUG_FOR_FBSTRING + #endif // FOLLY_BASE_FBSTRING_H_