summaryrefslogtreecommitdiff
path: root/include/sal/types.h
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-05-10 16:42:16 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-05-10 16:42:16 +0200
commit14cd5182c5f64c43581c82db8c958369152226ac (patch)
tree57f150ba2707f29214eeb9b1eaad2373780d1b15 /include/sal/types.h
parente4bb2b4f4875c15bd68297b5be716edd6859841e (diff)
Replace fallthrough comments with new SAL_FALLTHROUGH macro
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in preparation of enabling -Wimplicit-fallthrough. (This is only relevant for C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.) Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but that would require adding back in dependencies on boost_headers to many libraries where we carefully removed any remaining Boost dependencies only recently. (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its future evolution will not have any impact on the stable URE interface.) C++17 will have a proper [[fallthroug]], eventually removing the need for a macro altogether. Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
Diffstat (limited to 'include/sal/types.h')
-rw-r--r--include/sal/types.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/sal/types.h b/include/sal/types.h
index 80df8865fa20..d72e9ee7df35 100644
--- a/include/sal/types.h
+++ b/include/sal/types.h
@@ -445,6 +445,14 @@ namespace css = ::com::sun::star;
#define SAL_CONSTEXPR
#endif
+#if defined LIBO_INTERNAL_ONLY
+#if defined __clang__
+#define SAL_FALLTHROUGH [[clang::fallthrough]]
+#else
+#define SAL_FALLTHROUGH
+#endif
+#endif
+
#endif /* __cplusplus */
#ifdef __cplusplus