1 ## Copyright (C) 1996-2015 The Squid Software Foundation and contributors
3 ## Squid software is distributed under GPLv2+ license and includes
4 ## contributions from numerous individuals and organizations.
5 ## Please see the COPYING and CONTRIBUTORS files for details.
9 ## AX_CXX_TYPE_NULLPTR shamelessly copied from the DUNE sources under GPL version 2
11 AC_DEFUN([AX_CXX_TYPE_NULLPTR],[
12 AC_REQUIRE([AC_PROG_CXX])
14 AC_MSG_CHECKING([whether nullptr is supported])
15 AC_TRY_COMPILE([],[char* ch = nullptr;], [
17 AC_MSG_RESULT(yes)], [
20 if test "x$HAVE_NULLPTR" = xno; then
21 AC_DEFINE(nullptr, NULL, [Leave undefined if nullptr is supported])
23 AC_MSG_CHECKING([whether nullptr_t is supported])
24 AC_TRY_COMPILE([#include <cstddef>],[typedef nullptr_t peng;], [
26 AC_MSG_RESULT(yes)], [
29 if test "x$HAVE_NULLPTR_T" = xyes; then
30 AC_DEFINE(HAVE_NULLPTR_T, 1, [Define to 1 if nullptr_t is supported])
35 ## Hand crafted for Squid under GPL version 2
36 AC_DEFUN([AX_CXX_TYPE_UNIQUE_PTR],[
37 AC_REQUIRE([AC_PROG_CXX])
39 AC_MSG_CHECKING([whether std::unique_ptr<T> is supported])
40 AC_TRY_COMPILE([#include <memory>],[std::unique_ptr<char> c;], [
42 AC_MSG_RESULT(yes)], [
45 if test "x$HAVE_UNIQUE_PTR" = xno; then
46 AC_DEFINE(unique_ptr, auto_ptr, [Leave undefined if std::unique_ptr<T> is supported])
48 if test "x$HAVE_UNIQUE_PTR" = xyes; then
49 AC_DEFINE(HAVE_UNIQUE_PTR, 1, [Define to 1 if std::unique_ptr<T> is supported])
54 ## Hand crafted for Squid under GPL version 2
55 AC_DEFUN([AX_CXX_TYPE_UNIFORM_DISTRIBUTIONS],[
56 AC_REQUIRE([AC_PROG_CXX])
58 AC_MSG_CHECKING([whether std::uniform_int_distribution<T> is supported])
59 AC_TRY_COMPILE([#include <random>],[std::uniform_int_distribution<int> c;], [
60 HAVE_UNIFORM_INT_DISTRIBUTION=yes
61 AC_MSG_RESULT(yes)], [
62 HAVE_UNIFORM_INT_DISTRIBUTION=no
64 if test "x$HAVE_UNIFORM_INT_DISTRIBUTION" = xno; then
65 AC_DEFINE(uniform_int_distributon, tr1::uniform_int, [Leave undefined if std::uniform_int_distribution<T> is supported])
67 AC_MSG_CHECKING([whether std::uniform_real_distribution<T> is supported])
68 AC_TRY_COMPILE([#include <random>],[std::uniform_real_distribution<double> c;], [
69 HAVE_UNIFORM_REAL_DISTRIBUTION=yes
70 AC_MSG_RESULT(yes)], [
71 HAVE_UNIFORM_REAL_DISTRIBUTION=no
73 if test "x$HAVE_UNIFORM_REAL_DISTRIBUTION" = xno; then
74 AC_DEFINE(uniform_real_distributon, tr1::uniform_real, [Leave undefined if std::uniform_real_distribution<T> is supported])