mirror of
https://github.com/ipxe/ipxe
synced 2025-12-19 11:00:27 +03:00
[build] Provide common ARRAY_SIZE() definition
Several files define the ARRAY_SIZE() macro as used in Linux. Provide a common definition for this in include/compiler.h. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -655,6 +655,13 @@ char __debug_disable(OBJECT) = ( DBGLVL_MAX & ~DBGLVL_DFLT );
|
||||
#define barrier() __asm__ __volatile__ ( "" : : : "memory" )
|
||||
#endif /* ASSEMBLY */
|
||||
|
||||
/**
|
||||
* Array size
|
||||
*/
|
||||
#ifndef ASSEMBLY
|
||||
#define ARRAY_SIZE(array) ( sizeof (array) / sizeof ( (array)[0] ) )
|
||||
#endif /* ASSEMBLY */
|
||||
|
||||
/**
|
||||
* @defgroup licences Licence declarations
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user