2 dnl See whether we need a declaration for a function.
3 dnl Copyright (C) 2003 Jan Kratochvil <project-macros@jankratochvil.net>
5 dnl This program is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; exactly version 2 of June 1991 is required
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program; if not, write to the Free Software
16 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
20 AC_DEFUN([GCC_NEED_DECLARATION],
21 [AC_MSG_CHECKING([whether $1 must be declared])
22 AC_CACHE_VAL(gcc_cv_decl_needed_$1,
39 [char *(*pfn) = (char *(*)) $1],
40 eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
41 if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
43 gcc_need_declarations="$gcc_need_declarations $1"
44 gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
45 AC_DEFINE_UNQUOTED($gcc_tr_decl)
51 dnl Check multiple functions to see whether each needs a declaration.
52 dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
53 AC_DEFUN([GCC_NEED_DECLARATIONS],
56 GCC_NEED_DECLARATION($ac_func, $2)