diff --git a/ChangeLog b/ChangeLog index ef5ea7e8..66bd0cf5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-20 Nicolas François + + * lib/defines.h: Added MIN and MAX macros. + * libmisc/salt.c: Removed MIN and MAX macros. + 2009-04-20 Sven Joachim * NEWS, src/lastlog.c: Fix regression causing empty reports. diff --git a/lib/defines.h b/lib/defines.h index 1014ea9d..9a81e832 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -348,4 +348,12 @@ extern char *strerror (); # define unused #endif +/* ! Arguments evaluated twice ! */ +#ifndef MIN +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#endif +#ifndef MAX +#define MAX(x,y) (((x) > (y)) ? (x) : (y)) +#endif + #endif /* _DEFINES_H_ */ diff --git a/libmisc/salt.c b/libmisc/salt.c index d61908f6..d73646f6 100644 --- a/libmisc/salt.c +++ b/libmisc/salt.c @@ -94,10 +94,6 @@ static size_t SHA_salt_size (void) return (size_t) (8 + rand_size); } -/* ! Arguments evaluated twice ! */ -#define MAX(x,y) ((x) > (y) ? (x) : (y)) -#define MIN(x,y) ((x) < (y) ? (x) : (y)) - /* Default number of rounds if not explicitly specified. */ #define ROUNDS_DEFAULT 5000 /* Minimum number of rounds. */