OP* (CPERLscope(*op_ppaddr))(pTHX); \
MADPROP_IN_BASEOP \
PADOFFSET op_targ; \
- unsigned op_type:9; \
- unsigned op_opt:1; \
- unsigned op_latefree:1; \
- unsigned op_latefreed:1; \
- unsigned op_attached:1; \
- unsigned op_spare:3; \
+ PERL_BITFIELD16 op_type:9; \
+ PERL_BITFIELD16 op_opt:1; \
+ PERL_BITFIELD16 op_latefree:1; \
+ PERL_BITFIELD16 op_latefreed:1; \
+ PERL_BITFIELD16 op_attached:1; \
+ PERL_BITFIELD16 op_spare:3; \
U8 op_flags; \
U8 op_private;
#endif
};
#endif
+/* macros to define bit-fields in structs. */
+#ifndef PERL_BITFIELD8
+# define PERL_BITFIELD8 unsigned
+#endif
+#ifndef PERL_BITFIELD16
+# define PERL_BITFIELD16 unsigned
+#endif
+#ifndef PERL_BITFIELD32
+# define PERL_BITFIELD32 unsigned
+#endif
+
#include "sv.h"
#include "regexp.h"
#include "util.h"
I32 sublen; /* Length of string pointed by subbeg */ \
/* Information about the match that isn't often used */ \
/* offset from wrapped to the start of precomp */ \
- unsigned pre_prefix:4; \
+ PERL_BITFIELD32 pre_prefix:4; \
/* number of eval groups in the pattern - for security checks */\
- unsigned seen_evals:28
+ PERL_BITFIELD32 seen_evals:28
typedef struct regexp {
_XPV_HEAD;
_SV_HEAD(void*);
_SV_HEAD_UNION;
#ifdef DEBUG_LEAKING_SCALARS
- unsigned sv_debug_optype:9; /* the type of OP that allocated us */
- unsigned sv_debug_inpad:1; /* was allocated in a pad for an OP */
- unsigned sv_debug_cloned:1; /* was cloned for an ithread */
- unsigned sv_debug_line:16; /* the line where we were allocated */
+ PERL_BITFIELD32 sv_debug_optype:9; /* the type of OP that allocated us */
+ PERL_BITFIELD32 sv_debug_inpad:1; /* was allocated in a pad for an OP */
+ PERL_BITFIELD32 sv_debug_cloned:1; /* was cloned for an ithread */
+ PERL_BITFIELD32 sv_debug_line:16; /* the line where we were allocated */
char * sv_debug_file; /* the file where we were allocated */
#endif
};
# NOTE: we assume that GCC uses MSVCRT.DLL
# See comments about PERL_MSVCRT_READFIX in the "cl" compiler section below.
-BUILDOPT += -fno-strict-aliasing -DPERL_MSVCRT_READFIX
+BUILDOPT += -fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX
.ELSE
/* Compiler-specific stuff. */
+#if defined(_MSC_VER) || defined(__MINGW32__)
+/* VC uses non-standard way to determine the size and alignment if bit-fields */
+/* MinGW will compiler with -mms-bitfields, so should use the same types */
+# define PERL_BITFIELD8 unsigned char
+# define PERL_BITFIELD16 unsigned short
+# define PERL_BITFIELD32 unsigned int
+#endif
+
#ifdef __BORLANDC__ /* Borland C++ */
#if (__BORLANDC__ <= 0x520)