Change 30704 by [EMAIL PROTECTED] on 2007/03/22 23:48:39
Implement BmFLAGS() for 5.8.x. Not exactly pretty.
(And the irony is that the C structure always had enough space for a
member for this 1 byte value)
Affected files ...
... //depot/maint-5.8/perl/sv.h#82 edit
Differences ...
==== //depot/maint-5.8/perl/sv.h#82 (text) ====
Index: perl/sv.h
--- perl/sv.h#81~30469~ 2007-03-05 11:20:16.000000000 -0800
+++ perl/sv.h 2007-03-22 16:48:39.000000000 -0700
@@ -1020,13 +1020,19 @@
} \
} STMT_END
-#define BmRARE(sv) ((XPVBM*) SvANY(sv))->xbm_rare
-#define BmUSEFUL(sv) ((XPVBM*) SvANY(sv))->xbm_useful
-#define BmPREVIOUS(sv) ((XPVBM*) SvANY(sv))->xbm_previous
#define PERL_FBM_TABLE_OFFSET 2 /* Number of bytes between EOS and
table */
#define PERL_FBM_FLAGS_OFFSET_FROM_TABLE -1
+#define BmFLAGS(sv) ((SvVALID(sv) && SvPOK(sv) && \
+ (SvLEN(sv) > (SvCUR(sv) + PERL_FBM_TABLE_OFFSET))) \
+ ? SvPVX(sv)[SvCUR(sv) + PERL_FBM_TABLE_OFFSET \
+ + PERL_FBM_FLAGS_OFFSET_FROM_TABLE] \
+ : 0)
+#define BmRARE(sv) ((XPVBM*) SvANY(sv))->xbm_rare
+#define BmUSEFUL(sv) ((XPVBM*) SvANY(sv))->xbm_useful
+#define BmPREVIOUS(sv) ((XPVBM*) SvANY(sv))->xbm_previous
+
#define FmLINES(sv) ((XPVFM*) SvANY(sv))->xfm_lines
#define LvTYPE(sv) ((XPVLV*) SvANY(sv))->xlv_type
End of Patch.