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.

42 lines
1.3KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_cxx_explicit.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CXX_EXPLICIT
  8. #
  9. # DESCRIPTION
  10. #
  11. # If the compiler can be asked to prevent using implicitly one argument
  12. # constructors as converting constructors with the explicit keyword,
  13. # define HAVE_EXPLICIT.
  14. #
  15. # LICENSE
  16. #
  17. # Copyright (c) 2008 Todd Veldhuizen
  18. # Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
  19. #
  20. # Copying and distribution of this file, with or without modification, are
  21. # permitted in any medium without royalty provided the copyright notice
  22. # and this notice are preserved. This file is offered as-is, without any
  23. # warranty.
  24. #serial 7
  25. AU_ALIAS([AC_CXX_EXPLICIT], [AX_CXX_EXPLICIT])
  26. AC_DEFUN([AX_CXX_EXPLICIT],
  27. [AC_CACHE_CHECK(whether the compiler supports the explicit keyword,
  28. ax_cv_cxx_explicit,
  29. [AC_LANG_SAVE
  30. AC_LANG_CPLUSPLUS
  31. AC_TRY_COMPILE([class A{public:explicit A(double){}};],
  32. [double c = 5.0;A x(c);return 0;],
  33. ax_cv_cxx_explicit=yes, ax_cv_cxx_explicit=no)
  34. AC_LANG_RESTORE
  35. ])
  36. if test "$ax_cv_cxx_explicit" = yes; then
  37. AC_DEFINE(HAVE_EXPLICIT,,[define if the compiler supports the explicit keyword])
  38. fi
  39. ])