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