mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-22 20:05:36 +08:00
Add _ALIGN macro based on one in libmisc/shell/fts.c
This commit is contained in:
parent
dc4c4909f0
commit
772d929a3c
@ -155,6 +155,18 @@
|
||||
#define MJUM9BYTES (9 * 1024) /* jumbo cluster 9k */
|
||||
#define MJUM16BYTES (16 * 1024) /* jumbo cluster 16k */
|
||||
|
||||
/*
|
||||
* Round p (pointer or byte index) up to a correctly-aligned value
|
||||
* for all data types (int, long, ...). The result is u_long and
|
||||
* must be cast to any desired pointer type.
|
||||
*/
|
||||
#ifndef _ALIGNBYTES
|
||||
#define _ALIGNBYTES (sizeof(long) - 1)
|
||||
#endif
|
||||
#ifndef _ALIGN
|
||||
#define _ALIGN(p) (((uintptr_t)(p) + _ALIGNBYTES) &~ _ALIGNBYTES)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Some macros for units conversion
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user