Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.4KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_cxx_have_ref.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CXX_HAVE_REF()
  8. #
  9. # DESCRIPTION
  10. #
  11. # This macro checks if std::ref, added in C++11, is defined in the
  12. # <functional> header.
  13. #
  14. # If it is, define the ax_cv_cxx_have_ref environment variable to "yes"
  15. # and define HAVE_CXX_REF.
  16. #
  17. # LICENSE
  18. #
  19. # Copyright (c) 2014 Enrico M. Crisostomo <enrico.m.crisostomo@gmail.com>
  20. #
  21. # Copying and distribution of this file, with or without modification, are
  22. # permitted in any medium without royalty provided the copyright notice
  23. # and this notice are preserved. This file is offered as-is, without any
  24. # warranty.
  25. #serial 3
  26. AC_DEFUN([AX_CXX_HAVE_REF],
  27. [AC_CACHE_CHECK(
  28. [for std::ref in functional],
  29. ax_cv_cxx_have_ref,
  30. [dnl
  31. AC_LANG_PUSH([C++])
  32. AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
  33. [
  34. [#include <functional>]
  35. [using namespace std;]
  36. ],
  37. [
  38. [int one(1);]
  39. [auto refed = ref(one);]
  40. [++refed;]
  41. ]
  42. )],
  43. [ax_cv_cxx_have_ref=yes],
  44. [ax_cv_cxx_have_ref=no]
  45. )
  46. AC_LANG_POP([C++])])
  47. if test x"$ax_cv_cxx_have_ref" = "xyes"
  48. then
  49. AC_DEFINE(HAVE_CXX_REF,
  50. 1,
  51. [Define if functional defines the std::ref class.])
  52. fi
  53. ])