aboutsummaryrefslogtreecommitdiffstats
path: root/llabs.c
blob: edf4c82e3f70e906a8f3b985cb156bd77928c343 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* See LICENSE file for copyright and license details. */
#include "internal.h"


long long int
liberror_llabs(long long int i)
{
#if LLONG_MIN == -LLONG_MAX
	return llabs(i);
#else
	if (i != LLONG_MIN)
		return llabs(i);
	liberror_set_error_errno("The absolute value of largest negative integer "
	                         "cannot be represented as a signed integer",
	                         "llabs", EOVERFLOW);
	return i;
#endif
}