+#define RXp_EXTFLAGS(rx) ((rx)->extflags)
+
+/* For source compatibility. We used to store these explicitly. */
+#define RX_PRECOMP(prog) (RX_WRAPPED(prog) + ((struct regexp *)SvANY(prog))->pre_prefix)
+/* FIXME? Are we hardcoding too much here and constraining plugin extension
+ writers? Specifically, the value 1 assumes that the wrapped version always
+ has exactly one character at the end, a ')'. Will that always be true? */
+#define RX_PRELEN(prog) (RX_WRAPLEN(prog) - ((struct regexp *)SvANY(prog))->pre_prefix - 1)
+#define RX_WRAPPED(prog) SvPVX(prog)
+#define RX_WRAPLEN(prog) SvCUR(prog)
+#define RX_CHECK_SUBSTR(prog) (((struct regexp *)SvANY(prog))->check_substr)
+#define RX_REFCNT(prog) SvREFCNT(prog)
+#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
+# define RX_EXTFLAGS(prog) \
+ (*({ \
+ const REGEXP *const thwape = (prog); \
+ assert(SvTYPE(thwape) == SVt_REGEXP); \
+ &RXp_EXTFLAGS(SvANY(thwape)); \
+ }))
+# define RX_ENGINE(prog) \
+ (*({ \
+ const REGEXP *const thwape = (prog); \
+ assert(SvTYPE(thwape) == SVt_REGEXP); \
+ &SvANY(thwape)->engine; \
+ }))
+# define RX_SUBBEG(prog) \
+ (*({ \
+ const REGEXP *const thwape = (prog); \
+ assert(SvTYPE(thwape) == SVt_REGEXP); \
+ &SvANY(thwape)->subbeg; \
+ }))
+# define RX_OFFS(prog) \
+ (*({ \
+ const REGEXP *const thwape = (prog); \
+ assert(SvTYPE(thwape) == SVt_REGEXP); \
+ &SvANY(thwape)->offs; \
+ }))
+# define RX_NPARENS(prog) \
+ (*({ \
+ const REGEXP *const thwape = (prog); \
+ assert(SvTYPE(thwape) == SVt_REGEXP); \
+ &SvANY(thwape)->nparens; \
+ }))
+#else
+# define RX_EXTFLAGS(prog) RXp_EXTFLAGS((struct regexp *)SvANY(prog))
+# define RX_ENGINE(prog) (((struct regexp *)SvANY(prog))->engine)
+# define RX_SUBBEG(prog) (((struct regexp *)SvANY(prog))->subbeg)
+# define RX_OFFS(prog) (((struct regexp *)SvANY(prog))->offs)
+# define RX_NPARENS(prog) (((struct regexp *)SvANY(prog))->nparens)
+#endif
+#define RX_SUBLEN(prog) (((struct regexp *)SvANY(prog))->sublen)
+#define RX_MINLEN(prog) (((struct regexp *)SvANY(prog))->minlen)
+#define RX_MINLENRET(prog) (((struct regexp *)SvANY(prog))->minlenret)
+#define RX_GOFS(prog) (((struct regexp *)SvANY(prog))->gofs)
+#define RX_LASTPAREN(prog) (((struct regexp *)SvANY(prog))->lastparen)
+#define RX_LASTCLOSEPAREN(prog) (((struct regexp *)SvANY(prog))->lastcloseparen)
+#define RX_SEEN_EVALS(prog) (((struct regexp *)SvANY(prog))->seen_evals)
+#define RX_SAVED_COPY(prog) (((struct regexp *)SvANY(prog))->saved_copy)
+