diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-01-30 18:38:13 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-01-30 21:35:36 +0100 |
commit | 3891d323cdc3c03154f5682baaeaa4b2ef015a63 (patch) | |
tree | bb0882eeb9f36eb03a5c6c269c892428544dfd02 | |
parent | 086b070e31f607ffc4b057eef54669b95d774279 (diff) |
Introduce SAL_OVERRIDE
Change-Id: I3675b627d5e9ca19b2c4fb69fef12d0dabf94a43
-rw-r--r-- | config/config_global.h.in | 1 | ||||
-rw-r--r-- | configure.ac | 33 | ||||
-rw-r--r-- | oox/inc/oox/vml/vmlshape.hxx | 4 | ||||
-rw-r--r-- | sal/inc/sal/types.h | 13 |
4 files changed, 49 insertions, 2 deletions
diff --git a/config/config_global.h.in b/config/config_global.h.in index 7080a69635ea..0f85b59c3785 100644 --- a/config/config_global.h.in +++ b/config/config_global.h.in @@ -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 diff --git a/configure.ac b/configure.ac index e49cc3814313..a707d4a88b29 100644 --- a/configure.ac +++ b/configure.ac @@ -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 =================================================================== diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx index 8373d4ff8674..f1a96523e9ce 100644 --- a/oox/inc/oox/vml/vmlshape.hxx +++ b/oox/inc/oox/vml/vmlshape.hxx @@ -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 diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h index 8ada6d7ae729..117de03b4df9 100644 --- a/sal/inc/sal/types.h +++ b/sal/inc/sal/types.h @@ -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 |