P99

◆ P99_UNLIKELY

#define P99_UNLIKELY (   ...)    P99_EXPECT(!!(__VA_ARGS__), 0)

Mark the conditional expression as being unlikely.

This can be useful e.g to test returns of system functions. Many of these return 0 if everything goes well and something else otherwise.

Use with care, as humans are particularly bad at branch prediction. If unsure, first test your conditional for some time

to see that the case is really as unlikely as you think.

See also
P99_EXPECT
P99_LIKELY

Definition at line 994 of file p99_compiler.h.