Kaydet (Commit) 3891d323 authored tarafından Miklos Vajna's avatar Miklos Vajna

Introduce SAL_OVERRIDE

Change-Id: I3675b627d5e9ca19b2c4fb69fef12d0dabf94a43
üst 086b070e
......@@ -13,6 +13,7 @@ Any change in this header will cause a rebuild of almost everything.
#define CONFIG_GLOBAL_H
#undef HAVE_CXX11_DELETE
#undef HAVE_CXX11_OVERRIDE
#undef HAVE_GCC_BUILTIN_ATOMIC
#undef HAVE_SFINAE_ANONYMOUS_BROKEN
#undef HAVE_THREADSAFE_STATICS
......
......@@ -5649,6 +5649,39 @@ else
AC_MSG_RESULT([no (C++11 disabled)])
fi
dnl ==================================
dnl Check for C++11 "override" support
dnl ==================================
AC_MSG_CHECKING([whether $CXX supports C++11 override syntax])
if test "$HAVE_CXX0X" = "TRUE"; then
save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
struct A
{
virtual void test();
};
struct B : A
{
virtual void test() override;
};
]])],[HAVE_CXX11_OVERRIDE=TRUE],[])
AC_LANG_POP([C++])
CXXFLAGS=$save_CXXFLAGS
if test "$HAVE_CXX11_OVERRIDE" = "TRUE"; then
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_CXX11_OVERRIDE])
else
AC_MSG_RESULT([no])
fi
else
AC_MSG_RESULT([no (C++11 disabled)])
fi
dnl ===================================================================
dnl system stl sanity tests
dnl ===================================================================
......
......@@ -340,9 +340,9 @@ public:
protected:
/** Returns the absolute shape rectangle. */
virtual ::com::sun::star::awt::Rectangle getAbsRectangle() const;
virtual ::com::sun::star::awt::Rectangle getAbsRectangle() const SAL_OVERRIDE;
/** Returns the rectangle relative to the parent coordinate system. */
virtual ::com::sun::star::awt::Rectangle getRelRectangle() const;
virtual ::com::sun::star::awt::Rectangle getRelRectangle() const SAL_OVERRIDE;
};
/** Bezier shape object that supports to, from, control1 and control2
......
......@@ -416,6 +416,19 @@ namespace css = ::com::sun::star;
#define SAL_DELETED_FUNCTION
#endif
/** C++11 "override" feature.
With HAVE_CXX11_OVERRIDE, force the method to override a existing method in
parent, error out if the method with the correct signature does not exist.
@since LibreOffice 4.1
*/
#if defined HAVE_CXX11_OVERRIDE
#define SAL_OVERRIDE override
#else
#define SAL_OVERRIDE
#endif
#endif /* __cplusplus */
#ifdef __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