esp_compiler: generate likely and unlikely macros only when performance optimization is selected as build option

This commit is contained in:
Felipe Neves 2019-11-21 12:17:57 -03:00
parent 1b76253e0e
commit 668b33dcf3

View file

@ -22,7 +22,12 @@
* to reorder instructions producing more optimized
* code.
*/
#if (CONFIG_COMPILER_OPTIMIZATION_PERF)
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else
#define likely(x) (x)
#define unlikely(x) (x)
#endif
#endif