[go: up one dir, main page]

File: check_c_alignof.m4

package info (click to toggle)
fakechroot 2.19-3.3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,148 kB
  • sloc: ansic: 6,893; sh: 5,995; makefile: 349; perl: 169; java: 5
file content (31 lines) | stat: -rw-r--r-- 1,225 bytes parent folder | download | duplicates (8)
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
26
27
28
29
30
31
# check_c_alignof.m4 - check if C compiler supports __alignof__ keyword
#
# Copyright (c) 2010 Piotr Roszatycki <dexter@debian.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.

# ACX_CHECK_C_ALIGNOF([HEADER])
# -------------------------------------------
AC_DEFUN([ACX_CHECK_C_ALIGNOF],
    [m4_define([myname], [HAVE___ALIGNOF__])
        AH_TEMPLATE(AS_TR_CPP(myname),
            [Define to 1 if compiler supports `__alignof__' syntax.])
        AS_VAR_PUSHDEF([acx_var], [acx_cv_c_alignof])
        AC_CACHE_CHECK([whether compiler supports __alignof__ syntax],
            acx_var,
            [AC_LINK_IFELSE([AC_LANG_PROGRAM([
$1
@%:@include <stdio.h>
                    ], [
int a = __alignof__(char);
                    ])],
            [AS_VAR_SET(acx_var, [yes])], [AS_VAR_SET(acx_var, [no])])])
        AS_VAR_IF(acx_var, [yes],
            [AC_DEFINE_UNQUOTED(AS_TR_CPP(myname), [1])
                AS_VAR_SET(acx_var, [yes])])
        AS_VAR_POPDEF([acx_var])
        m4_undefine([myname])
])