mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[liba] Add abs function for int
Change-Id: Ic133ff2f34c7ff24ecbec69d5f31e447a72ae4fe
This commit is contained in:
committed by
Émilie Feral
parent
0a92499dd7
commit
53e204db3a
@@ -3,6 +3,7 @@ SFLAGS += -Iliba/include
|
||||
liba_src += $(addprefix liba/src/, \
|
||||
armv7m/setjmp.s \
|
||||
armv7m/longjmp.s \
|
||||
abs.c \
|
||||
assert.c \
|
||||
bzero.c \
|
||||
ctype.c \
|
||||
|
||||
@@ -13,6 +13,8 @@ void * calloc(size_t count, size_t size);
|
||||
|
||||
void abort(void) __attribute__((noreturn));
|
||||
|
||||
int abs(int n);
|
||||
|
||||
LIBA_END_DECLS
|
||||
|
||||
#endif
|
||||
|
||||
5
liba/src/abs.c
Normal file
5
liba/src/abs.c
Normal file
@@ -0,0 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
int abs(int n) {
|
||||
return n < 0 ? -n : n;
|
||||
}
|
||||
Reference in New Issue
Block a user