Use _Static_assert() if available
authorAlireza Haghdoost <haghdoost@gmail.com>
Mon, 29 Jun 2015 19:09:37 +0000 (13:09 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 29 Jun 2015 19:09:37 +0000 (13:09 -0600)
commit5018f79f6d8da82b6fafbbeeebdecb3799788bc3
tree65470310f65ace5b47954696d50795f6809b4c68
parent2a2743361cf643b9dd2ba3e491da62e7cb83a101
Use _Static_assert() if available

The current compiletime_assert() doesn't work properly if code
optimization is not enabled, causing all compile time asserts to fail
regardless of the condition. This is because the compiler doesn't
realize that the external function will never get called for the
false case.

Use _Static_assert() if available for compiletime_assert(), and
fallback to the old method if we don't have it.

Signed-off-by: Jens Axboe <axboe@fb.com>
compiler/compiler.h
configure