Skip to content

Commit

Permalink
Avoid non-int bitfields only on some platforms
Browse files Browse the repository at this point in the history
A Configure probe was added in the previous commit to find platforms
which require allow struct bitfields to be integer-sized.

This commit uses it.
  • Loading branch information
khwilliamson committed Jun 5, 2021
1 parent 6f68e10 commit d30e9ad
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions perl.h
Expand Up @@ -4064,13 +4064,25 @@ typedef struct crypt_data { /* straight from /usr/include/crypt.h */

/* macros to define bit-fields in structs. */
#ifndef PERL_BITFIELD8
# define PERL_BITFIELD8 U8
# ifdef HAS_NON_INT_BITFIELDS
# define PERL_BITFIELD8 U8
# else
# define PERL_BITFIELD8 int
# endif
#endif
#ifndef PERL_BITFIELD16
# define PERL_BITFIELD16 U16
# ifdef HAS_NON_INT_BITFIELDS
# define PERL_BITFIELD16 U16
# else
# define PERL_BITFIELD16 int
# endif
#endif
#ifndef PERL_BITFIELD32
# define PERL_BITFIELD32 U32
# ifdef HAS_NON_INT_BITFIELDS
# define PERL_BITFIELD32 U32
# else
# define PERL_BITFIELD32 int
# endif
#endif

#include "sv.h"
Expand Down

0 comments on commit d30e9ad

Please sign in to comment.