fixup libobjc usage of PCC_BITFIELD_TYPE_MATTERS
[official-gcc.git] / config / bitfields.m4
blobee8f3b5baba03b5ff840d358e77939eeb05c8e97
1 dnl Copyright (C) 2015 Free Software Foundation, Inc.
2 dnl This file is free software, distributed under the terms of the GNU
3 dnl General Public License.  As a special exception to the GNU General
4 dnl Public License, this file may be distributed as part of a program
5 dnl that contains a configuration script generated by Autoconf, under
6 dnl the same distribution terms as the rest of that program.
8 # Define HAVE_BITFIELD_TYPE_MATTERS if the type of bitfields effects their
9 # alignment.
11 AC_DEFUN([gt_BITFIELD_TYPE_MATTERS],
13   AC_CACHE_CHECK([if the type of bitfields matters], gt_cv_bitfield_type_matters,
14   [
15     AC_TRY_COMPILE(
16       [struct foo1 { char x; char :0; char y; };
17 struct foo2 { char x; int :0; char y; };
18 int foo1test[ sizeof (struct foo1) == 2 ? 1 : -1 ];
19 int foo2test[ sizeof (struct foo2) == 5 ? 1 : -1]; ],
20       [], gt_cv_bitfield_type_matters=yes, gt_cv_bitfield_type_matters=no)
21   ])
22   if test $gt_cv_bitfield_type_matters = yes; then
23     AC_DEFINE(HAVE_BITFIELD_TYPE_MATTERS, 1,
24       [Define if the type of bitfields effects alignment.])
25   fi