mirror of
https://github.com/ipxe/ipxe
synced 2026-02-14 02:31:26 +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:
@@ -545,8 +545,8 @@ static int arbel_mad ( struct ib_device *ibdev, union ib_mad *mad ) {
|
||||
union arbelprm_mad mad_ifc;
|
||||
int rc;
|
||||
|
||||
linker_assert ( sizeof ( *mad ) == sizeof ( mad_ifc.mad ),
|
||||
mad_size_mismatch );
|
||||
/* Sanity check */
|
||||
static_assert ( sizeof ( *mad ) == sizeof ( mad_ifc.mad ) );
|
||||
|
||||
/* Copy in request packet */
|
||||
memcpy ( &mad_ifc.mad, mad, sizeof ( mad_ifc.mad ) );
|
||||
|
||||
@@ -779,8 +779,8 @@ static int hermon_mad ( struct ib_device *ibdev, union ib_mad *mad ) {
|
||||
union hermonprm_mad mad_ifc;
|
||||
int rc;
|
||||
|
||||
linker_assert ( sizeof ( *mad ) == sizeof ( mad_ifc.mad ),
|
||||
mad_size_mismatch );
|
||||
/* Sanity check */
|
||||
static_assert ( sizeof ( *mad ) == sizeof ( mad_ifc.mad ) );
|
||||
|
||||
/* Copy in request packet */
|
||||
memcpy ( &mad_ifc.mad, mad, sizeof ( mad_ifc.mad ) );
|
||||
|
||||
Reference in New Issue
Block a user