diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2013-02-14 12:37:53 +0100 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2013-02-14 12:37:53 +0100 |
commit | a52c8f6bd5e498ac712eebf1e9894566f8626f99 (patch) | |
tree | 539c7f0b9892b90a1dbab499bfc025e44e657829 /gmp-impl.h | |
parent | 8a50608a253175e093006267c12fa38e013850e2 (diff) | |
download | gmp-a52c8f6bd5e498ac712eebf1e9894566f8626f99.tar.gz |
gmp-impl.h (NEG_CAST): New macro, used by ABS_CAST.
Diffstat (limited to 'gmp-impl.h')
-rw-r--r-- | gmp-impl.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gmp-impl.h b/gmp-impl.h index 7be65eecb..d4d50e13d 100644 --- a/gmp-impl.h +++ b/gmp-impl.h @@ -506,7 +506,8 @@ __GMP_DECLSPEC void __gmp_tmp_debug_free (const char *, int, int, #define UNLIKELY(cond) __GMP_UNLIKELY(cond) #define ABS(x) ((x) >= 0 ? (x) : -(x)) -#define ABS_CAST(T,x) ((x) >= 0 ? (T)(x) : -((T)((x) + 1) - 1)) +#define NEG_CAST(T,x) (-((T)((x) + 1) - 1)) +#define ABS_CAST(T,x) ((x) >= 0 ? (T)(x) : NEG_CAST(T,x)) #undef MIN #define MIN(l,o) ((l) < (o) ? (l) : (o)) #undef MAX |