This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
undef $0 shouldn't warn about $0
[perl5.git] / handy.h
diff --git a/handy.h b/handy.h
index d131cfc..11009d3 100644 (file)
--- a/handy.h
+++ b/handy.h
@@ -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
@@ -489,6 +498,7 @@ Returns zero if non-equal, or non-zero if equal.
 #  define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
 #endif
 
+/* memEQ and memNE where second comparand is a string constant */
 #define memEQs(s1, l, s2) \
        (sizeof(s2)-1 == l && memEQ(s1, ("" s2 ""), (sizeof(s2)-1)))
 #define memNEs(s1, l, s2) !memEQs(s1, l, s2)