1 ## Copyright (C) 2015 The libxml++ development team
3 ## This file is part of libxml++.
5 ## This library is free software; you can redistribute it and/or
6 ## modify it under the terms of the GNU Lesser General Public
7 ## License as published by the Free Software Foundation; either
8 ## version 2.1 of the License, or (at your option) any later version.
10 ## This library is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## Lesser General Public License for more details.
15 ## You should have received a copy of the GNU Lesser General Public
16 ## License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 ## LIBXMLXX_CXX_HAS_EXCEPTION_PTR()
20 ## Test whether std::exception_ptr, std::current_exception() and
21 ## std::rethrow_exception() are defined.
23 ## On success, #define LIBXMLXX_HAVE_EXCEPTION_PTR to 1.
25 AC_DEFUN([LIBXMLXX_CXX_HAS_EXCEPTION_PTR],
28 [whether C++ library supports std::exception_ptr],
29 [libxmlxx_cv_cxx_has_exception_ptr],
31 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
41 std::exception_ptr ep = std::current_exception();
42 std::rethrow_exception(ep);
45 [libxmlxx_cv_cxx_has_exception_ptr='yes'],
46 [libxmlxx_cv_cxx_has_exception_ptr='no']
50 AS_IF([test "x${libxmlxx_cv_cxx_has_exception_ptr}" = 'xyes'],
51 [AC_DEFINE([LIBXMLXX_HAVE_EXCEPTION_PTR], [1], [Defined if the C++ library supports std::exception_ptr.])])