func.m4 715 B

123456789101112131415161718192021
  1. # func.m4 serial 2
  2. dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. # Written by Simon Josefsson
  7. AC_DEFUN([gl_FUNC],
  8. [
  9. AC_CACHE_CHECK([whether __func__ is available], [gl_cv_var_func],
  10. AC_COMPILE_IFELSE(
  11. [AC_LANG_PROGRAM([[]], [[const char *str = __func__;]])],
  12. [gl_cv_var_func=yes],
  13. [gl_cv_var_func=no]))
  14. if test "$gl_cv_var_func" != yes; then
  15. AC_DEFINE([__func__], ["<unknown function>"],
  16. [Define as a replacement for the ISO C99 __func__ variable.])
  17. fi
  18. ])