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.

57 lines
1.7KB

  1. # =============================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_cxx_have_placeholders.html
  3. # =============================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CXX_HAVE_PLACEHOLDERS()
  8. #
  9. # DESCRIPTION
  10. #
  11. # This macro checks if std::placeholders, added in C++11, is defined in
  12. # the <functional> header.
  13. #
  14. # If it is, define the ax_cv_cxx_have_placeholders environment variable to
  15. # "yes" and define HAVE_CXX_PLACEHOLDERS.
  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 2
  26. AC_DEFUN([AX_CXX_HAVE_PLACEHOLDERS],
  27. [AC_CACHE_CHECK(
  28. [for std::placeholders in functional],
  29. ax_cv_cxx_have_placeholders,
  30. [dnl
  31. AC_LANG_PUSH([C++])
  32. AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
  33. [
  34. [#include <functional>]
  35. [using namespace std;]
  36. [using namespace std::placeholders;]
  37. [int fn(int x, int y) { return x + y; }]
  38. ],
  39. [
  40. [auto bound_function = bind (fn, 10, _1);]
  41. [bound_function(20);]
  42. ]
  43. )],
  44. [ax_cv_cxx_have_placeholders=yes],
  45. [ax_cv_cxx_have_placeholders=no]
  46. )
  47. AC_LANG_POP([C++])])
  48. if test x"$ax_cv_cxx_have_placeholders" = "xyes"
  49. then
  50. AC_DEFINE(HAVE_CXX_PLACEHOLDERS,
  51. 1,
  52. [Define if functional defines the std::placeholders namespace.])
  53. fi
  54. ])