Instead of having each file have them, keep them in handy.h, but only
for core compilations.
/* 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
#define STATIC static
#endif
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
-
-#ifndef MAX
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-#endif
-
/* this is a chain of data about sub patterns we are processing that
need to be handled separately/specially in study_chunk. Its so
we can simulate recursion without losing state. */
*/
#ifdef EBCDIC
-# ifndef MIN
-# define MIN(a,b) ((a) < (b) ? (a) : (b))
-# endif
/* [0] is start byte [1] [2] [3] [4] [5] [6] [7] */
const U8 * const prefix = "\x41\x41\x41\x41\x41\x41\x42";