Home | History | Annotate | Line # | Download | only in config
bitfields.m4 revision 1.1.1.1
      1  1.1  mrg dnl Copyright (C) 2015 Free Software Foundation, Inc.
      2  1.1  mrg dnl This file is free software, distributed under the terms of the GNU
      3  1.1  mrg dnl General Public License.  As a special exception to the GNU General
      4  1.1  mrg dnl Public License, this file may be distributed as part of a program
      5  1.1  mrg dnl that contains a configuration script generated by Autoconf, under
      6  1.1  mrg dnl the same distribution terms as the rest of that program.
      7  1.1  mrg 
      8  1.1  mrg # Define HAVE_BITFIELD_TYPE_MATTERS if the type of bitfields effects their
      9  1.1  mrg # alignment.
     10  1.1  mrg 
     11  1.1  mrg AC_DEFUN([gt_BITFIELD_TYPE_MATTERS],
     12  1.1  mrg [
     13  1.1  mrg   AC_CACHE_CHECK([if the type of bitfields matters], gt_cv_bitfield_type_matters,
     14  1.1  mrg   [
     15  1.1  mrg     AC_TRY_COMPILE(
     16  1.1  mrg       [struct foo1 { char x; char y:1; char z; };
     17  1.1  mrg struct foo2 { char x; long long int y:1; char z; };
     18  1.1  mrg int foo1test[ sizeof (struct foo1) < sizeof (struct foo2) ? 1 : -1 ]; ],
     19  1.1  mrg       [], gt_cv_bitfield_type_matters=yes, gt_cv_bitfield_type_matters=no)
     20  1.1  mrg   ])
     21  1.1  mrg   if test $gt_cv_bitfield_type_matters = yes; then
     22  1.1  mrg     AC_DEFINE(HAVE_BITFIELD_TYPE_MATTERS, 1,
     23  1.1  mrg       [Define if the type of bitfields effects alignment.])
     24  1.1  mrg   fi
     25  1.1  mrg ])
     26