base/stdlib.h: abs/labs
This commit is contained in:
parent
b4f49cc48f
commit
2dc346dfd6
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue