+#define __PACKAGE__ "Variable::Magic"
+
+#define R(S) fprintf(stderr, "R(" #S ") = %d\n", SvREFCNT(S))
+
+/* --- Compatibility ------------------------------------------------------- */
+
+#ifndef Newx
+# define Newx(v, n, c) New(0, v, n, c)
+#endif
+
+#ifndef SvMAGIC_set
+# define SvMAGIC_set(sv, val) (SvMAGIC(sv) = (val))
+#endif
+
+#ifndef dMY_CXT
+# define MY_CXT vmg_globaldata
+# define dMY_CXT
+# define START_MY_CXT STATIC my_cxt_t MY_CXT;
+# define MY_CXT_INIT
+#endif
+
+/* --- Context-safe global data -------------------------------------------- */
+
+#define MY_CXT_KEY __PACKAGE__ "::_guts" XS_VERSION
+
+typedef struct {
+ HV *wizz;
+ U16 count;
+} my_cxt_t;
+
+START_MY_CXT
+
+/* --- Signatures ---------------------------------------------------------- */
+
+#define SIG_MIN ((U16) (1u << 8))
+#define SIG_MAX ((U16) (1u << 16 - 1))
+#define SIG_NBR (SIG_MAX - SIG_MIN + 1)