diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 6e1168e73..30cdf47a1 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -113,4 +113,14 @@ IF(NOT TPARM_TAKES_VARARGS) SET(TPARM_SOLARIS_KLUDGE 1) ENDIF() +CHECK_CXX_SOURCE_COMPILES(" +#include + +int main () { + std::unique_ptr foo = std::make_unique(); +} +" + HAVE_STD__MAKE_UNIQUE +) + FIND_PROGRAM(SED sed) diff --git a/configure.ac b/configure.ac index 4f923266d..1640984d7 100644 --- a/configure.ac +++ b/configure.ac @@ -400,6 +400,15 @@ AC_TRY_LINK( [ #include ], [AC_MSG_RESULT(no)], ) +AC_MSG_CHECKING([for std::make_unique]) +AC_TRY_LINK( [ #include ], + [ std::unique_ptr foo = std::make_unique(); ], + [ AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_STD__MAKE_UNIQUE, 1, Define to 1 if you have the `std::make_unique' function.) + ], + [AC_MSG_RESULT(no)], + ) + if test x$local_gettext != xno; then AC_CHECK_FUNCS( gettext ) diff --git a/src/common.h b/src/common.h index 85b8f170e..1809eab1c 100644 --- a/src/common.h +++ b/src/common.h @@ -606,7 +606,7 @@ wcstring vformat_string(const wchar_t *format, va_list va_orig); void append_format(wcstring &str, const wchar_t *format, ...); void append_formatv(wcstring &str, const wchar_t *format, va_list ap); -#ifdef __cpp_lib_make_unique +#ifdef HAVE_STD__MAKE_UNIQUE using std::make_unique; #else /// make_unique implementation