mirror of
https://github.com/ipxe/ipxe
synced 2026-01-31 03:30:54 +03:00
[libc] Make static_assert() available via assert.h
Expose static_assert() via assert.h and migrate link-time assertions to build-time assertions where possible. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -55,6 +55,15 @@ assert_printf ( const char *fmt, ... ) asm ( "printf" );
|
||||
} \
|
||||
} while ( 0 )
|
||||
|
||||
/**
|
||||
* Assert a condition at build time
|
||||
*
|
||||
* If the compiler cannot prove that the condition is true, the build
|
||||
* will fail with an error message.
|
||||
*/
|
||||
#undef static_assert
|
||||
#define static_assert(x) _Static_assert( x, #x )
|
||||
|
||||
/**
|
||||
* Assert a condition at link-time.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user