2003-04-22 21:02:15 +02:00
|
|
|
#ifndef STDLIB_H
|
|
|
|
#define STDLIB_H
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
2007-10-27 22:05:21 +02:00
|
|
|
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
|
|
|
|
2008-12-23 18:34:15 +01:00
|
|
|
#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
|
|
|
|
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
|
|
|
|
|
2008-03-19 21:24:33 +01:00
|
|
|
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
|
|
|
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
|
|
|
|
2007-11-07 20:02:35 +01:00
|
|
|
#ifndef __ROMCC__
|
2009-09-25 23:59:57 +02:00
|
|
|
void *malloc(size_t size);
|
2003-04-22 21:02:15 +02:00
|
|
|
void free(void *ptr);
|
2007-11-07 20:02:35 +01:00
|
|
|
#endif
|
2003-04-22 21:02:15 +02:00
|
|
|
|
|
|
|
#endif /* STDLIB_H */
|