File: bitfields.m4

package info (click to toggle)
gdb 8.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 223,696 kB
  • sloc: ansic: 1,936,156; asm: 341,757; exp: 146,606; makefile: 56,749; sh: 23,776; cpp: 20,830; yacc: 12,914; perl: 5,331; ada: 4,977; python: 4,617; xml: 4,176; pascal: 3,134; lisp: 1,527; cs: 879; lex: 620; f90: 479; sed: 228; awk: 140; objc: 134; fortran: 43
file content (25 lines) | stat: -rw-r--r-- 1,051 bytes parent folder | download | duplicates (41)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 y:1; char z; };
struct foo2 { char x; long long int y:1; char z; };
int foo1test[ sizeof (struct foo1) < sizeof (struct foo2) ? 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
])