Skip to content

Commit

Permalink
Merge d30e9ad into 1c1bafd
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilliamson committed Jun 6, 2021
2 parents 1c1bafd + d30e9ad commit 1003453
Show file tree
Hide file tree
Showing 15 changed files with 76 additions and 7 deletions.
33 changes: 33 additions & 0 deletions Configure
Expand Up @@ -394,6 +394,7 @@ d_attribute_unused=''
d_attribute_warn_unused_result=''
d_printf_format_null=''
d_backtrace=''
d_non_int_bitfields=''
d_builtin_choose_expr=''
d_builtin_expect=''
d_builtin_add_overflow=''
Expand Down Expand Up @@ -16541,6 +16542,37 @@ eval $inhdr
set nl_langinfo d_nl_langinfo
eval $inlibc

: Look for non 'int'-sized bitfields
case "$d_non_int_bitfields" in
'')
echo " " >&4
echo "Checking whether your compiler can handle struct bitfields that aren't 'int' or 'unsigned int' ..." >&4
$cat >try.c <<'EOCP'
#include <stdio.h>
struct foo {
unsigned char byte:1;
unsigned short halfword:1;
} bar;
EOCP
if $cc $ccflags -c try.c >try.out 2>&1 ; then
if $compiler_warning try.out >/dev/null 2>&1; then
echo "Your C compiler doesn't support struct bitfields that aren't 'int' or 'unsigned int'." >&4
val="$undef"
else
echo "Your C compiler supports struct bitfields besides 'int' and 'unsigned int'." >&4
val="$define"
fi
else
echo "Your C compiler doesn't seem to understand struct bitfields that aren't 'int' or 'unsigned int' at all." >&4
val="$undef"
fi
;;
*) val="$d_non_int_bitfields" ;;
esac
set d_non_int_bitfields
eval $setvar
$rm_try

: see if this is a quadmath.h system
set quadmath.h i_quadmath
eval $inhdr
Expand Down Expand Up @@ -24527,6 +24559,7 @@ d_nextafter='$d_nextafter'
d_nexttoward='$d_nexttoward'
d_nice='$d_nice'
d_nl_langinfo='$d_nl_langinfo'
d_non_int_bitfields='$d_non_int_bitfields'
d_nv_preserves_uv='$d_nv_preserves_uv'
d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
d_off64_t='$d_off64_t'
Expand Down
1 change: 1 addition & 0 deletions Cross/config.sh-arm-linux
Expand Up @@ -418,6 +418,7 @@ d_nextafter='undef'
d_nexttoward='undef'
d_nice='define'
d_nl_langinfo='define'
d_non_int_bitfields='define'
d_nv_preserves_uv='define'
d_nv_zero_is_allbits_zero='undef'
d_off64_t='undef'
Expand Down
1 change: 1 addition & 0 deletions Cross/config.sh-arm-linux-n770
Expand Up @@ -417,6 +417,7 @@ d_nextafter='undef'
d_nexttoward='undef'
d_nice='define'
d_nl_langinfo='define'
d_non_int_bitfields='define'
d_nv_preserves_uv='define'
d_nv_zero_is_allbits_zero='undef'
d_off64_t='undef'
Expand Down
1 change: 1 addition & 0 deletions NetWare/config.wc
Expand Up @@ -407,6 +407,7 @@ d_nextafter='undef'
d_nexttoward='undef'
d_nice='undef'
d_nl_langinfo='undef'
d_non_int_bitfields='define'
d_nv_preserves_uv='define'
d_nv_zero_is_allbits_zero='undef'
d_off64_t='undef'
Expand Down
1 change: 1 addition & 0 deletions Porting/config.sh
Expand Up @@ -436,6 +436,7 @@ d_nextafter='define'
d_nexttoward='define'
d_nice='define'
d_nl_langinfo='define'
d_non_int_bitfields='define'
d_nv_preserves_uv='define'
d_nv_zero_is_allbits_zero='undef'
d_off64_t='define'
Expand Down
7 changes: 7 additions & 0 deletions config_h.SH
Expand Up @@ -2339,6 +2339,13 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
*/
#$d_atanh HAS_ATANH /**/
/* HAS_NON_INT_BITFIELDS:
* This symbol, if defined, indicates that the C compiler accepts, without
* error or warning, struct bitfields that are declared with sizes other
* than plain 'int'; for example 'unsigned char' is accepted.
*/
#$d_non_int_bitfields HAS_NON_INT_BITFIELDS /**/
/* HAS_BUILTIN_CHOOSE_EXPR:
* Can we handle GCC builtin for compile-time ternary-like expressions
*/
Expand Down
2 changes: 2 additions & 0 deletions configure.com
Expand Up @@ -5610,6 +5610,7 @@ $ d_mbstowcs="define"
$ d_mbtowc="define"
$ d_mktime="define"
$ d_nl_langinfo="define"
$ d_non_int_bitfields="define"
$ d_setlocale="define"
$ d_setlocale_accepts_any_locale_name="undef"
$ d_stdiobase="define"
Expand Down Expand Up @@ -6399,6 +6400,7 @@ $ WC "d_nextafter='" + d_nextafter + "'"
$ WC "d_nexttoward='" + d_nexttoward + "'"
$ WC "d_nice='define'"
$ WC "d_nl_langinfo='" + d_nl_langinfo + "'"
$ WC "d_non_int_bitfields='define'"
$ WC "d_getenv_preserves_other_thread='" + d_getenv_preserves_other_thread + "'"
$ WC "d_nv_preserves_uv='" + d_nv_preserves_uv + "'"
$ WC "nv_overflows_integers_at='" + nv_overflows_integers_at + "'"
Expand Down
3 changes: 1 addition & 2 deletions metaconfig.h
Expand Up @@ -13,7 +13,6 @@
* Symbols should only be here temporarily. Once they are actually used,
* they should be removed from here.
*
* HAS_WCRTOMB
* GETENV_PRESERVES_OTHER_THREAD
* HAS_NON_INT_BITFIELDS
*
*/
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
1 change: 1 addition & 0 deletions plan9/config_sh.sample
Expand Up @@ -418,6 +418,7 @@ d_nextafter='undef'
d_nexttoward='undef'
d_nice='undef'
d_nl_langinfo='undef'
d_non_int_bitfields='define'
d_nv_preserves_uv='undef'
d_nv_zero_is_allbits_zero='undef'
d_off64_t='undef'
Expand Down
11 changes: 9 additions & 2 deletions uconfig.h
Expand Up @@ -2304,6 +2304,13 @@
*/
/*#define HAS_ATANH / **/

/* HAS_NON_INT_BITFIELDS:
* This symbol, if defined, indicates that the C compiler accepts, without
* error or warning, struct bitfields that are declared with sizes other
* than plain 'int'; for example 'unsigned char' is accepted.
*/
#define HAS_NON_INT_BITFIELDS /**/

/* HAS_BUILTIN_CHOOSE_EXPR:
* Can we handle GCC builtin for compile-time ternary-like expressions
*/
Expand Down Expand Up @@ -5282,6 +5289,6 @@
#endif

/* Generated from:
* 6edd641b187b02d0daa8cb53f5d22f2dcca115a0d3e744f51b0292d2db484ca5 config_h.SH
* a0fa823df68d3b6a854579e3727e8d354614ad995d17f68b691399261825c2d3 uconfig.sh
* dac70e6e1bbb594cb13128b2271cfd83bc32d4cb1d14179edc6100597299d0bf config_h.SH
* bad73e58d466bfe6befab92731c4d075d5d439b45fd11c20585b3514865093a8 uconfig.sh
* ex: set ro: */
1 change: 1 addition & 0 deletions uconfig.sh
Expand Up @@ -358,6 +358,7 @@ d_nextafter='undef'
d_nexttoward='undef'
d_nice='undef'
d_nl_langinfo='undef'
d_non_int_bitfields='define'
d_nv_preserves_uv='undef'
d_nv_zero_is_allbits_zero='undef'
d_off64_t='undef'
Expand Down
1 change: 1 addition & 0 deletions uconfig64.sh
Expand Up @@ -358,6 +358,7 @@ d_nextafter='undef'
d_nexttoward='undef'
d_nice='undef'
d_nl_langinfo='undef'
d_non_int_bitfields='define'
d_nv_preserves_uv='undef'
d_nv_zero_is_allbits_zero='undef'
d_off64_t='undef'
Expand Down
1 change: 1 addition & 0 deletions win32/config.gc
Expand Up @@ -407,6 +407,7 @@ d_nextafter='define'
d_nexttoward='define'
d_nice='undef'
d_nl_langinfo='undef'
d_non_int_bitfields='define'
d_nv_preserves_uv='define'
d_nv_zero_is_allbits_zero='define'
d_off64_t='undef'
Expand Down
1 change: 1 addition & 0 deletions win32/config.vc
Expand Up @@ -407,6 +407,7 @@ d_nextafter='undef'
d_nexttoward='undef'
d_nice='undef'
d_nl_langinfo='undef'
d_non_int_bitfields='define'
d_nv_preserves_uv='define'
d_nv_zero_is_allbits_zero='define'
d_off64_t='undef'
Expand Down

0 comments on commit 1003453

Please sign in to comment.