Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32501
Change subject: include: Implement abs()
......................................................................
include: Implement abs()
There are a few external libraries that make use of this simple
function.
Change-Id: I0719de6558cf9224ecbbd46b6f8a8040e8225a79
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/include/stdlib.h
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/32501/1
diff --git a/src/include/stdlib.h b/src/include/stdlib.h
index 34ef93a..a396a3b 100644
--- a/src/include/stdlib.h
+++ b/src/include/stdlib.h
@@ -11,4 +11,9 @@
/* We never free memory */
static inline void free(void *ptr) {}
+static inline int abs(int i)
+{
+ return i < 0 ? -i : i;
+}
+
#endif /* STDLIB_H */
--
To view, visit https://review.coreboot.org/c/coreboot/+/32501
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I0719de6558cf9224ecbbd46b6f8a8040e8225a79
Gerrit-Change-Number: 32501
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange