~ubuntu-branches/ubuntu/maverick/uim/maverick

« back to all changes in this revision

Viewing changes to sigscheme/m4/ax_c___alignof__.m4

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2008-06-25 19:56:33 UTC
  • mfrom: (3.1.18 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080625195633-8jljph4rfq00l8o7
Tags: 1:1.5.1-2
* uim-tcode: provide tutcode-custom.scm, tutcode-bushudic.scm
  and tutcode-rule.scm (Closes: #482659)
* Fix FTBFS: segv during compile (Closes: #483078).
  I personally think this bug is not specific for uim but is a optimization
  problem on gcc-4.3.1. (https://bugs.freedesktop.org/show_bug.cgi?id=16477)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Copyright (C) 2006 YAMAMOTO Kengo <yamaken AT bp.iij4u.or.jp>
 
2
dnl
 
3
dnl Copying and distribution of this file, with or without modification,
 
4
dnl are permitted in any medium without royalty provided the copyright
 
5
dnl notice and this notice are preserved.
 
6
dnl
 
7
dnl
 
8
dnl @synopsis AX_C___ALIGNOF__
 
9
dnl
 
10
dnl Checks if __alignof__ operator is available.
 
11
dnl
 
12
dnl @category C
 
13
dnl @author YAMAMOTO Kengo <yamaken AT bp.iij4u.or.jp>
 
14
dnl @version 2006-12-12
 
15
dnl @license AllPermissive
 
16
 
 
17
AC_DEFUN([AX_C___ALIGNOF__], [
 
18
  AC_CACHE_CHECK([for __alignof__],
 
19
    [ax_cv_c___alignof__],
 
20
    [AC_COMPILE_IFELSE([[
 
21
struct _st {
 
22
  int i;
 
23
  char c;
 
24
  void *p;
 
25
};
 
26
 
 
27
int  c[__alignof__(char)];
 
28
int  s[__alignof__(short)];
 
29
int  i[__alignof__(int)];
 
30
int  l[__alignof__(long)];
 
31
int vp[__alignof__(void *)];
 
32
int st[__alignof__(struct _st)];
 
33
 
 
34
/* test whether ((__alignof__(type)) != 0) */
 
35
int  c2[((__alignof__(char))       > 0) ? 1 : -1];
 
36
int  s2[((__alignof__(short))      > 0) ? 1 : -1];
 
37
int  i2[((__alignof__(int))        > 0) ? 1 : -1];
 
38
int  l2[((__alignof__(long))       > 0) ? 1 : -1];
 
39
int vp2[((__alignof__(void *))     > 0) ? 1 : -1];
 
40
int st2[((__alignof__(struct _st)) > 0) ? 1 : -1];
 
41
 
 
42
int
 
43
f(void)
 
44
{
 
45
  short sv;
 
46
 
 
47
  return (__alignof__(sv) >= __alignof__(char));
 
48
}
 
49
      ]],
 
50
      [ax_cv_c___alignof__=yes],
 
51
      [ax_cv_c___alignof__=no])])
 
52
  if test "x$ax_cv_c___alignof__" = xyes; then
 
53
    AC_DEFINE([HAVE___ALIGNOF__], [1],
 
54
              [Define to 1 if __alignof__ operator is available.])
 
55
  fi
 
56
])