mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Add configure-time check for std::make_unique
Fixes the build on Clang 6 and closes #4685.
This commit is contained in:
parent
54cefeb5b1
commit
fb53a96a1c
3 changed files with 20 additions and 1 deletions
|
@ -113,4 +113,14 @@ IF(NOT TPARM_TAKES_VARARGS)
|
|||
SET(TPARM_SOLARIS_KLUDGE 1)
|
||||
ENDIF()
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include <memory>
|
||||
|
||||
int main () {
|
||||
std::unique_ptr<int> foo = std::make_unique<int>();
|
||||
}
|
||||
"
|
||||
HAVE_STD__MAKE_UNIQUE
|
||||
)
|
||||
|
||||
FIND_PROGRAM(SED sed)
|
||||
|
|
|
@ -400,6 +400,15 @@ AC_TRY_LINK( [ #include <wchar.h> ],
|
|||
[AC_MSG_RESULT(no)],
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([for std::make_unique])
|
||||
AC_TRY_LINK( [ #include <memory> ],
|
||||
[ std::unique_ptr<int> foo = std::make_unique<int>(); ],
|
||||
[ 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 )
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue