URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
extern int inside_main;
|
extern int inside_main;
|
extern void abort (void);
|
extern void abort (void);
|
#ifdef __OPTIMIZE__
|
#ifdef __OPTIMIZE__
|
#define ABORT_INSIDE_MAIN do { if (inside_main) abort (); } while (0)
|
#define ABORT_INSIDE_MAIN do { if (inside_main) abort (); } while (0)
|
#else
|
#else
|
#define ABORT_INSIDE_MAIN do { } while (0)
|
#define ABORT_INSIDE_MAIN do { } while (0)
|
#endif
|
#endif
|
|
|
typedef __INTMAX_TYPE__ intmax_t;
|
typedef __INTMAX_TYPE__ intmax_t;
|
|
|
int
|
int
|
abs (int x)
|
abs (int x)
|
{
|
{
|
ABORT_INSIDE_MAIN;
|
ABORT_INSIDE_MAIN;
|
return x < 0 ? -x : x;
|
return x < 0 ? -x : x;
|
}
|
}
|
|
|
long
|
long
|
labs (long x)
|
labs (long x)
|
{
|
{
|
ABORT_INSIDE_MAIN;
|
ABORT_INSIDE_MAIN;
|
return x < 0 ? -x : x;
|
return x < 0 ? -x : x;
|
}
|
}
|
|
|
long long
|
long long
|
llabs (long long x)
|
llabs (long long x)
|
{
|
{
|
ABORT_INSIDE_MAIN;
|
ABORT_INSIDE_MAIN;
|
return x < 0 ? -x : x;
|
return x < 0 ? -x : x;
|
}
|
}
|
|
|
intmax_t
|
intmax_t
|
imaxabs (intmax_t x)
|
imaxabs (intmax_t x)
|
{
|
{
|
ABORT_INSIDE_MAIN;
|
ABORT_INSIDE_MAIN;
|
return x < 0 ? -x : x;
|
return x < 0 ? -x : x;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.