diff options
Diffstat (limited to 'support/dktools/dk4macll.ctr')
-rw-r--r-- | support/dktools/dk4macll.ctr | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/support/dktools/dk4macll.ctr b/support/dktools/dk4macll.ctr new file mode 100644 index 0000000000..0432660b48 --- /dev/null +++ b/support/dktools/dk4macll.ctr @@ -0,0 +1,73 @@ +%% options + +copyright owner = Dirk Krause +copyright year = 2015-xxxx +license = bsd + + + +%% header + +/** @file + Comparison between signed and unsigned + long long. +*/ + +#ifndef DK4CONF_H_INCLUDED +#include "dk4conf.h" +#endif + +#ifndef DK4TYPES_H_INCLUDED +#include "dk4types.h" +#endif + + + +#ifdef __cplusplus +extern "C" { +#endif + +#if DK4_HAVE_LONG_LONG + +/** Compare signed and unsigned long long. + @param s Signed long long. + @param u Unsigned long long. + @return 1 if s>u, 0 if s==u, -1 if s<u. +*/ +int +dk4ma_long_long_compare(long long s, unsigned long long u); + +#endif + +#ifdef __cplusplus +} +#endif + + + +%% module + +#include "dk4macll.h" + +#if DK4_HAVE_LONG_LONG + +int +dk4ma_long_long_compare(long long s, unsigned long long u) +{ + int back = 0; + if (0LL > s) { + back = -1; + } else { + if ((unsigned long long)s < u) { + back = -1; + } else { + if ((unsigned long long)s > u) { + back = 1; + } + } + } + return back; +} + +#endif + |