]> git.ipfire.org Git - thirdparty/squid.git/blame - acinclude/ax_cxx_0x_types.m4
Maintenance: remove unused mk-globals-c.pl script
[thirdparty/squid.git] / acinclude / ax_cxx_0x_types.m4
CommitLineData
bde978a6 1## Copyright (C) 1996-2015 The Squid Software Foundation and contributors
5d2e6f19
AJ
2##
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.
6##
7
8##
9## AX_CXX_TYPE_NULLPTR shamelessly copied from the DUNE sources under GPL version 2
a203dec7
AJ
10##
11AC_DEFUN([AX_CXX_TYPE_NULLPTR],[
12 AC_REQUIRE([AC_PROG_CXX])
13 AC_LANG_PUSH([C++])
14 AC_MSG_CHECKING([whether nullptr is supported])
15 AC_TRY_COMPILE([],[char* ch = nullptr;], [
16 HAVE_NULLPTR=yes
17 AC_MSG_RESULT(yes)], [
18 HAVE_NULLPTR=no
19 AC_MSG_RESULT(no)])
e513d9f1
AJ
20 if test "x$HAVE_NULLPTR" = xno; then
21 AC_DEFINE(nullptr, NULL, [Leave undefined if nullptr is supported])
a203dec7
AJ
22 fi
23 AC_MSG_CHECKING([whether nullptr_t is supported])
24 AC_TRY_COMPILE([#include <cstddef>],[typedef nullptr_t peng;], [
25 HAVE_NULLPTR_T=yes
26 AC_MSG_RESULT(yes)], [
27 HAVE_NULLPTR_T=no
28 AC_MSG_RESULT(no)])
29 if test "x$HAVE_NULLPTR_T" = xyes; then
30 AC_DEFINE(HAVE_NULLPTR_T, 1, [Define to 1 if nullptr_t is supported])
31 fi
32 AC_LANG_POP
33])
34
35## Hand crafted for Squid under GPL version 2
36AC_DEFUN([AX_CXX_TYPE_UNIQUE_PTR],[
37 AC_REQUIRE([AC_PROG_CXX])
38 AC_LANG_PUSH([C++])
39 AC_MSG_CHECKING([whether std::unique_ptr<T> is supported])
40 AC_TRY_COMPILE([#include <memory>],[std::unique_ptr<char> c;], [
41 HAVE_UNIQUE_PTR=yes
42 AC_MSG_RESULT(yes)], [
43 HAVE_UNIQUE_PTR=no
44 AC_MSG_RESULT(no)])
829030b5
AJ
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])
47 fi
a203dec7
AJ
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])
50 fi
51 AC_LANG_POP
52])
249b93df
AJ
53
54## Hand crafted for Squid under GPL version 2
55AC_DEFUN([AX_CXX_TYPE_UNIFORM_DISTRIBUTIONS],[
56 AC_REQUIRE([AC_PROG_CXX])
57 AC_LANG_PUSH([C++])
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
63 AC_MSG_RESULT(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])
66 fi
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
72 AC_MSG_RESULT(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])
75 fi
76 AC_LANG_POP
77])