… | |
… | |
386 | |
386 | |
387 | #if ECB_GCC_VERSION(4,5) |
387 | #if ECB_GCC_VERSION(4,5) |
388 | #define ecb_unreachable() __builtin_unreachable () |
388 | #define ecb_unreachable() __builtin_unreachable () |
389 | #else |
389 | #else |
390 | /* this seems to work fine, but gcc always emits a warning for it :/ */ |
390 | /* this seems to work fine, but gcc always emits a warning for it :/ */ |
391 | ecb_function_ void ecb_unreachable (void) ecb_noreturn; |
391 | ecb_inline void ecb_unreachable (void) ecb_noreturn; |
392 | ecb_function_ void ecb_unreachable (void) { } |
392 | ecb_inline void ecb_unreachable (void) { } |
393 | #endif |
393 | #endif |
394 | |
394 | |
395 | /* try to tell the compiler that some condition is definitely true */ |
395 | /* try to tell the compiler that some condition is definitely true */ |
396 | #define ecb_assume(cond) do { if (!(cond)) ecb_unreachable (); } while (0) |
396 | #define ecb_assume(cond) do { if (!(cond)) ecb_unreachable (); } while (0) |
397 | |
397 | |