diff options
author | Karl Williamson <khw@cpan.org> | 2016-09-21 16:15:08 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2016-09-25 22:24:20 -0600 |
commit | 98fce2a4417fa36585bb48f6ae845bee93cac0fa (patch) | |
tree | 1edae7daef33c90d1efe55b587e523e8858bc7c7 /handy.h | |
parent | 8bc127bf58304a1e46a3e33d30b0b8b6f21abb07 (diff) | |
download | perl-98fce2a4417fa36585bb48f6ae845bee93cac0fa.tar.gz |
Centralize definitions of MIN, MAX
Instead of having each file have them, keep them in handy.h, but only
for core compilations.
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -277,6 +277,15 @@ typedef U64TYPE U64; /* Unused by core; should be deprecated */ #define Ctl(ch) ((ch) & 037) +#if defined(PERL_CORE) || defined(PERL_EXT) +# ifndef MIN +# define MIN(a,b) ((a) < (b) ? (a) : (b)) +# endif +# ifndef MAX +# define MAX(a,b) ((a) > (b) ? (a) : (b)) +# endif +#endif + /* This is a helper macro to avoid preprocessor issues, replaced by nothing * unless under DEBUGGING, where it expands to an assert of its argument, * followed by a comma (hence the comma operator). If we just used a straight |