File: check-type.m4

package info (click to toggle)
claws-mail 3.8.1-2%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 36,556 kB
  • sloc: ansic: 196,305; sh: 12,332; xml: 12,184; perl: 2,487; makefile: 2,377; yacc: 2,334; lex: 292; python: 278
file content (27 lines) | stat: -rw-r--r-- 704 bytes parent folder | download | duplicates (4)
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
dnl CLAWS_CHECK_TYPE(TYPE, DEFAULT [, INCLUDES, COMMENT])
dnl
dnl Like AC_CHECK_TYPE, but in addition to `sys/types.h', `stdlib.h' and
dnl `stddef.h' checks files included by INCLUDES, which should be a
dnl series of #include statements.  If TYPE is not defined, define it
dnl to DEFAULT.
dnl
AC_DEFUN([CLAWS_CHECK_TYPE],
[AC_REQUIRE([AC_HEADER_STDC])dnl
AC_MSG_CHECKING(for $1)
AC_CACHE_VAL(claws_cv_type_$1,
[AC_TRY_COMPILE([
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
$3
], [
#undef $1
int a = sizeof($1);
], claws_cv_type_$1=yes, claws_cv_type_$1=no)])dnl
AC_MSG_RESULT($claws_cv_type_$1)
if test $claws_cv_type_$1 = no; then
  AC_DEFINE($1, $2, $4)
fi
])