diff options
author | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-02 04:11:07 +0000 |
---|---|---|
committer | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-02 04:11:07 +0000 |
commit | 9ea9539044cf52b5286446864683cb18051561e2 (patch) | |
tree | fee646565688a42fe976a306924b04532245ff8c /config | |
parent | 47239e3ff6478d3e282851de628efb9a28a1d856 (diff) | |
download | gcc-9ea9539044cf52b5286446864683cb18051561e2.tar.gz |
fixup libobjc usage of PCC_BITFIELD_TYPE_MATTERS
libobjc/ChangeLog:
2015-05-01 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* acinclude.m4: Include bitfields.m4.
* config.h.in: Regenerate.
* configure: Likewise.
* configure.ac: Invoke gt_BITFIELD_TYPE_MATTERS.
* encoding.c: Check HAVE_BITFIELD_TYPE_MATTERS.
config/ChangeLog:
2015-05-01 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* bitfields.m4: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222715 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'config')
-rw-r--r-- | config/bitfields.m4 | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/config/bitfields.m4 b/config/bitfields.m4 new file mode 100644 index 00000000000..ee8f3b5baba --- /dev/null +++ b/config/bitfields.m4 @@ -0,0 +1,26 @@ +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 +]) |