base/stdlib.h: abs/labs

This commit is contained in:
Sebastien Bourdeauducq 2012-06-04 19:41:49 +02:00
parent b4f49cc48f
commit 2dc346dfd6
1 changed files with 9 additions and 1 deletions

View File

@ -32,7 +32,15 @@
#define likely(x) x
#define unlikely(x) x
#define abs(x) ((x) > 0 ? (x) : -(x))
static inline int abs(int x)
{
return x > 0 ? x : -x;
}
static inline long int labs(long int x)
{
return x > 0 ? x : -x;
}
unsigned long strtoul(const char *nptr, char **endptr, int base);
int skip_atoi(const char **s);