From ae942840140e38835e562e8d235578c017d00766 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 17 Nov 2015 02:31:11 +0100 Subject: add macros for abs, labs, llabs, and imaxabs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/stdlib/abs/abs.c | 2 +- src/stdlib/abs/labs.c | 2 +- src/stdlib/abs/llabs.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/stdlib/abs') diff --git a/src/stdlib/abs/abs.c b/src/stdlib/abs/abs.c index 9452a5b..9bc3bd4 100644 --- a/src/stdlib/abs/abs.c +++ b/src/stdlib/abs/abs.c @@ -30,7 +30,7 @@ * @param value The integer. * @return The absolute value of the integer. */ -int abs(int value) +int (abs)(int value) { return value < 0 ? -value : value; } diff --git a/src/stdlib/abs/labs.c b/src/stdlib/abs/labs.c index 360122d..20d0ac6 100644 --- a/src/stdlib/abs/labs.c +++ b/src/stdlib/abs/labs.c @@ -30,7 +30,7 @@ * @param value The integer. * @return The absolute value of the integer. */ -long int labs(long int value) +long int (labs)(long int value) { return value < 0 ? -value : value; } diff --git a/src/stdlib/abs/llabs.c b/src/stdlib/abs/llabs.c index 23ae2ed..71e5a1b 100644 --- a/src/stdlib/abs/llabs.c +++ b/src/stdlib/abs/llabs.c @@ -30,7 +30,7 @@ * @param value The integer. * @return The absolute value of the integer. */ -long long int llabs(long long int value) +long long int (llabs)(long long int value) { return value < 0 ? -value : value; } -- cgit v1.2.3-70-g09d2