gnucash/macros/need-declaration.m4
Dave Peticolas 859a6da3af * src/FileDialog.c (gncFileNew): clear the non-iso commodities
* src/engine/gnc-commodity.c (gnc_commodity_table_remove_non_iso):
	new func

	* src/test/test-xml-commodity.c: remove duplicate string_to_integer

	* src/gnome/dialog-userpass.c: add missing #include

	* src/register/gnome/Makefile.am: add gnome & glib flags

	* src/engine/Makefile.am: add glib libs

	* src/engine/sql/Makefile.am: add glib flags

	* configure.in: fix includes used to check for sizes

	* acinclude.m4: fix guppi macro

	* macros/: update m4 files


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3776 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-03-14 02:44:25 +00:00

43 lines
1.1 KiB
Plaintext

dnl See whether we need a declaration for a function.
dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
AC_DEFUN([GCC_NEED_DECLARATION],
[AC_MSG_CHECKING([whether $1 must be declared])
AC_CACHE_VAL(gcc_cv_decl_needed_$1,
[AC_TRY_COMPILE([
#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
#else
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
$2],
[char *(*pfn) = (char *(*)) $1],
eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
AC_MSG_RESULT(yes)
gcc_need_declarations="$gcc_need_declarations $1"
gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
AC_DEFINE_UNQUOTED($gcc_tr_decl)
else
AC_MSG_RESULT(no)
fi
])dnl
dnl Check multiple functions to see whether each needs a declaration.
dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
AC_DEFUN([GCC_NEED_DECLARATIONS],
[for ac_func in $1
do
GCC_NEED_DECLARATION($ac_func, $2)
done
]
)