Kaydet (Commit) 7ffdd830 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now

...but for safety, leave the configure.ac check in for some longer.

Also, save removing now-redundant SAL_FALLTHROUGH for a follow-up commit.

Change-Id: I9bf42d237aea4c09459f28275568cf340e588607
Reviewed-on: https://gerrit.libreoffice.org/64770
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 7d928d8c
...@@ -21,9 +21,6 @@ Any change in this header will cause a rebuild of almost everything. ...@@ -21,9 +21,6 @@ Any change in this header will cause a rebuild of almost everything.
/* Compiler supports __attribute__((warn_unused)). */ /* Compiler supports __attribute__((warn_unused)). */
#define HAVE_GCC_ATTRIBUTE_WARN_UNUSED 0 #define HAVE_GCC_ATTRIBUTE_WARN_UNUSED 0
/* [[fallthrough]] (C++17), __has_cpp_attribute(fallthrough) (C++2a): */
#define HAVE_CPP_ATTRIBUTE_FALLTHROUGH 0
/* [[nodiscard]] (C++17), __has_cpp_attribute(nodiscard) (C++2a): */ /* [[nodiscard]] (C++17), __has_cpp_attribute(nodiscard) (C++2a): */
#define HAVE_CPP_ATTRIBUTE_NODISCARD 0 #define HAVE_CPP_ATTRIBUTE_NODISCARD 0
......
...@@ -6413,7 +6413,8 @@ if test "$GCC" = yes; then ...@@ -6413,7 +6413,8 @@ if test "$GCC" = yes; then
fi fi
AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION]) AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
AC_MSG_CHECKING([[whether $CXX supports [[fallthrough]]]]) dnl This check can eventually be removed completely (e.g., after libreoffice-6-3 branch off):
AC_MSG_CHECKING([[that $CXX supports [[fallthrough]]]])
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11" CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
...@@ -6441,10 +6442,8 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ ...@@ -6441,10 +6442,8 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
} }
} }
#endif #endif
]])], [ ]])],
AC_DEFINE([HAVE_CPP_ATTRIBUTE_FALLTHROUGH],[1]) AC_MSG_RESULT([yes]), AC_MSG_ERROR([$CXX lacks required [[fallthrough]] support]))
AC_MSG_RESULT([yes])
], [AC_MSG_RESULT([no])])
CXXFLAGS=$save_CXXFLAGS CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++]) AC_LANG_POP([C++])
......
...@@ -410,15 +410,7 @@ namespace css = ::com::sun::star; ...@@ -410,15 +410,7 @@ namespace css = ::com::sun::star;
#endif #endif
#if defined LIBO_INTERNAL_ONLY #if defined LIBO_INTERNAL_ONLY
#if HAVE_CPP_ATTRIBUTE_FALLTHROUGH
#define SAL_FALLTHROUGH [[fallthrough]] #define SAL_FALLTHROUGH [[fallthrough]]
#elif defined __clang__
/* before Clang 3.9, according to
<https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B17_features> */
#define SAL_FALLTHROUGH [[clang::fallthrough]]
#else
#define SAL_FALLTHROUGH
#endif
#endif #endif
#endif /* __cplusplus */ #endif /* __cplusplus */
......
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