--- /dev/null
+dnl Copyright (C) 2015 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# Define HAVE_BITFIELD_TYPE_MATTERS if the type of bitfields effects their
+# alignment.
+
+AC_DEFUN([gt_BITFIELD_TYPE_MATTERS],
+[
+ AC_CACHE_CHECK([if the type of bitfields matters], gt_cv_bitfield_type_matters,
+ [
+ AC_TRY_COMPILE(
+ [struct foo1 { char x; char :0; char y; };
+struct foo2 { char x; int :0; char y; };
+int foo1test[ sizeof (struct foo1) == 2 ? 1 : -1 ];
+int foo2test[ sizeof (struct foo2) == 5 ? 1 : -1]; ],
+ [], gt_cv_bitfield_type_matters=yes, gt_cv_bitfield_type_matters=no)
+ ])
+ if test $gt_cv_bitfield_type_matters = yes; then
+ AC_DEFINE(HAVE_BITFIELD_TYPE_MATTERS, 1,
+ [Define if the type of bitfields effects alignment.])
+ fi
+])
m4_include(../config/no-executables.m4)
m4_include(../config/enable.m4)
m4_include(../config/tls.m4)
+m4_include(../config/bitfields.m4)
m4_include(../libtool.m4)
dnl The lines below arrange for aclocal not to bring an installed
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Define if the type of bitfields effects alignment. */
+#undef HAVE_BITFIELD_TYPE_MATTERS
+
/* Define to 1 if the target assembler supports thread-local storage. */
#undef HAVE_CC_TLS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_exception_model_name" >&5
$as_echo "$ac_exception_model_name" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the type of bitfields matters" >&5
+$as_echo_n "checking if the type of bitfields matters... " >&6; }
+if test "${gt_cv_bitfield_type_matters+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+struct foo1 { char x; char :0; char y; };
+struct foo2 { char x; int :0; char y; };
+int foo1test[ sizeof (struct foo1) == 2 ? 1 : -1 ];
+int foo2test[ sizeof (struct foo2) == 5 ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gt_cv_bitfield_type_matters=yes
+else
+ gt_cv_bitfield_type_matters=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_bitfield_type_matters" >&5
+$as_echo "$gt_cv_bitfield_type_matters" >&6; }
+ if test $gt_cv_bitfield_type_matters = yes; then
+
+$as_echo "#define HAVE_BITFIELD_TYPE_MATTERS 1" >>confdefs.h
+
+ fi
+
+
# ------
# Output
# ------
AC_LANG_POP(C)
AC_MSG_RESULT($ac_exception_model_name)
+gt_BITFIELD_TYPE_MATTERS
+
# ------
# Output
# ------
/* FIXME: This file contains functions that will abort the entire
program if they fail. Is that really needed ? */
+#include "config.h"
#include "objc-private/common.h"
#include "objc-private/error.h"
#include "tconfig.h"
/* Record must have at least as much alignment as any field.
Otherwise, the alignment of the field within the record
is meaningless. */
-#if !PCC_BITFIELD_TYPE_MATTERS
+#ifndef HAVE_BITFIELD_TYPE_MATTERS
layout->record_align = MAX (layout->record_align, desired_align);
#else /* PCC_BITFIELD_TYPE_MATTERS */
if (*type == _C_BFLD)