Kaydet (Commit) 247d0795 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Make AC_LINK_IFELSE (to check HAVE_CPP_INLINE_VARIABLES) work on Windows

Change-Id: I6c71e079f21093d5f8dc4dbca20624e9fc927882
Reviewed-on: https://gerrit.libreoffice.org/60072
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 5ac1f17e
...@@ -6433,25 +6433,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([ ...@@ -6433,25 +6433,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
CXXFLAGS=$save_CXXFLAGS CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++]) AC_LANG_POP([C++])
AC_MSG_CHECKING([whether $CXX supports inline variables])
AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#if !defined __cpp_inline_variables
// This tests for one specific aspect of inline variables that is actually used by
// ORegistry::ROOT (registry/source/regimpl.cxx):
struct S { constexpr S() {} };
struct T { static constexpr S s{}; };
S const * f() { return &T::s; }
#endif
]])], [
AC_DEFINE([HAVE_CPP_INLINE_VARIABLES],[1])
AC_MSG_RESULT([yes])
], [AC_MSG_RESULT([no])])
CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++])
AC_MSG_CHECKING([whether $CXX has a fix for CWG1579]) AC_MSG_CHECKING([whether $CXX has a fix for CWG1579])
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS save_CXXFLAGS=$CXXFLAGS
...@@ -12435,6 +12416,32 @@ if test "$build_os" = "cygwin"; then ...@@ -12435,6 +12416,32 @@ if test "$build_os" = "cygwin"; then
AC_SUBST(ILIB) AC_SUBST(ILIB)
fi fi
AC_MSG_CHECKING([whether $CXX supports inline variables])
AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
if test "$build_os" = cygwin; then
save_LIB=$LIB
export LIB=$ILIB
fi
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#if !defined __cpp_inline_variables
// This tests for one specific aspect of inline variables that is actually used by
// ORegistry::ROOT (registry/source/regimpl.cxx):
struct S { constexpr S() {} };
struct T { static constexpr S s{}; };
S const * f() { return &T::s; }
#endif
]])], [
AC_DEFINE([HAVE_CPP_INLINE_VARIABLES],[1])
AC_MSG_RESULT([yes])
], [AC_MSG_RESULT([no])])
CXXFLAGS=$save_CXXFLAGS
if test "$build_os" = cygwin; then
LIB=$save_LIB
fi
AC_LANG_POP([C++])
dnl We should be able to drop the below check when bumping the GCC baseline to dnl We should be able to drop the below check when bumping the GCC baseline to
dnl 4.9, as <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54577> dnl 4.9, as <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54577>
dnl "deque<T>::erase() still takes iterator instead of const_iterator" should be dnl "deque<T>::erase() still takes iterator instead of const_iterator" should be
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment