1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-10-27 18:20:13 -04:00
trader/m4/warn-on-use.m4
John Zaitseff 6d846a2389 Add all auto-generated files and update PO/GMO files
The auto-generated files are created by running ./build-aux/bootstrap
with Gnulib as at commit f8fea966d67a6ba06231689e63f668bd55ee5797 (with a
date stamp of Thu Apr 12 18:56:54 2012 -0700), Autoconf 2.68, Automake
1.11.4 and Gettext 0.18.1.1.
2012-04-14 14:41:38 +10:00

48 lines
2.1 KiB
Plaintext

# warn-on-use.m4 serial 5
dnl Copyright (C) 2010-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# gl_WARN_ON_USE_PREPARE(INCLUDES, NAMES)
# ---------------------------------------
# For each whitespace-separated element in the list of NAMES, define
# HAVE_RAW_DECL_name if the function has a declaration among INCLUDES
# even after being undefined as a macro.
#
# See warn-on-use.h for some hints on how to poison function names, as
# well as ideas on poisoning global variables and macros. NAMES may
# include global variables, but remember that only functions work with
# _GL_WARN_ON_USE. Typically, INCLUDES only needs to list a single
# header, but if the replacement header pulls in other headers because
# some systems declare functions in the wrong header, then INCLUDES
# should do likewise.
#
# It is generally safe to assume declarations for functions declared
# in the intersection of C89 and C11 (such as printf) without
# needing gl_WARN_ON_USE_PREPARE.
AC_DEFUN([gl_WARN_ON_USE_PREPARE],
[
m4_foreach_w([gl_decl], [$2],
[AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])),
[Define to 1 if ]m4_defn([gl_decl])[ is declared even after
undefining macros.])])dnl
dnl FIXME: gl_Symbol must be used unquoted until we can assume
dnl autoconf 2.64 or newer.
for gl_func in m4_flatten([$2]); do
AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
AC_CACHE_CHECK([whether $gl_func is declared without a macro],
gl_Symbol,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1],
[@%:@undef $gl_func
(void) $gl_func;])],
[AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])])
AS_VAR_IF(gl_Symbol, [yes],
[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
dnl shortcut - if the raw declaration exists, then set a cache
dnl variable to allow skipping any later AC_CHECK_DECL efforts
eval ac_cv_have_decl_$gl_func=yes])
AS_VAR_POPDEF([gl_Symbol])dnl
done
])