20 lines
409 B
C
20 lines
409 B
C
#ifndef STDLIB_H
|
|
#define STDLIB_H
|
|
|
|
#include <stddef.h>
|
|
|
|
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
|
|
|
#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
|
|
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
|
|
|
|
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
|
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
|
|
|
#ifndef __ROMCC__
|
|
void *malloc(size_t size);
|
|
void free(void *ptr);
|
|
#endif
|
|
|
|
#endif /* STDLIB_H */
|