Commit c9b41e27 authored by Elizabeth Smith's avatar Elizabeth Smith Committed by Sara Golemon

fbstring likely/unlikley ifdef for stuff that doesn't support it

Summary: the fbstring specific unlikely/likely defs were missing the ifdef blocks to avoid breaking things without builtin_expect

Test Plan: fbmake runtests

Reviewed By: njormrod@fb.com

FB internal diff: D1282166
parent 8cd97e5f
......@@ -107,8 +107,13 @@
// We defined these here rather than including Likely.h to avoid
// redefinition errors when fbstring is imported into libstdc++.
#if defined(__GNUC__) && __GNUC__ >= 4
#define FBSTRING_LIKELY(x) (__builtin_expect((x), 1))
#define FBSTRING_UNLIKELY(x) (__builtin_expect((x), 0))
#else
#define FBSTRING_LIKELY(x) (x)
#define FBSTRING_UNLIKELY(x) (x)
#endif
// Ignore shadowing warnings within this file, so includers can use -Wshadow.
#pragma GCC diagnostic push
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment