%% options copyright owner = Dirk Krause copyright year = 2015-xxxx license = bsd %% header /** @file Comparison between signed and unsigned number (intmax_t and uintmax_t). */ #ifndef DK4CONF_H_INCLUDED #include "dk4conf.h" #endif #ifndef DK4TYPES_H_INCLUDED #include "dk4types.h" #endif #ifdef __cplusplus extern "C" { #endif #if DK4_HAVE_INTMAX_T /** Compare intmax_t and uintmax_t. @param s Signed intmax_t. @param u Unsigned intmax_t. @return 1 if s>u, 0 if s==u, -1 if s s) { back = -1; } else { if ((uintmax_t)s < u) { back = -1; } else { if ((uintmax_t)s > u) { back = 1; } } } return back; } #endif