File: ac_decl_or_zero.m4

package info (click to toggle)
kbtin 1.0.19-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,920 kB
  • sloc: ansic: 16,853; sh: 7,533; perl: 214; makefile: 127
file content (21 lines) | stat: -rw-r--r-- 538 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
dnl ***************************************
dnl *** AC_DECL_OR_ZERO(symbol, header) ***
dnl ***************************************
dnl
dnl Checks if the given symbol (rvalue) is defined in the given header
dnl -- if not, #defines it to 0.

AC_DEFUN([AC_DECL_OR_ZERO], [
  AC_MSG_CHECKING([for $1])
  AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <$2>
int main()
{
  char *p=(char*)$1;
  return !p;
}
])], [AC_MSG_RESULT([yes])], [
    AC_MSG_RESULT([no, defining as 0])
    AC_DEFINE([$1], [0], [Set to 0 if not supported])
    ])
  ])
])