summaryrefslogtreecommitdiff
path: root/include/sal/types.h
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-03-04 17:08:08 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-03-04 17:08:08 +0100
commit9055fb48402eaeb9ba876b7893e2f9a39fea06b1 (patch)
tree42be3cc7c12f4cd60da0ec0e6cc39609f68f47ef /include/sal/types.h
parentaf662f323d864e47d6218a2a63700e13b6e907fa (diff)
clang-cl: Enable more warnings etc. (like in the Clang/GCC case)
Change-Id: Ia1fb09b89d3ccc3c7f4a11799f0d8eac99c6c7a9
Diffstat (limited to 'include/sal/types.h')
-rw-r--r--include/sal/types.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/sal/types.h b/include/sal/types.h
index 7638eaeed139..86c7c730c073 100644
--- a/include/sal/types.h
+++ b/include/sal/types.h
@@ -317,7 +317,9 @@ typedef void * sal_Handle;
Compilers that support a construct of this nature will emit a compile
time warning on unchecked return value.
*/
-#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
+#if (defined __GNUC__ \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))) \
+ || defined __clang__
# define SAL_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
# define SAL_WARN_UNUSED_RESULT
@@ -491,7 +493,7 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
#if HAVE_GCC_DEPRECATED_MESSAGE
# define SAL_DEPRECATED(message) __attribute__((deprecated(message)))
-#elif (__GNUC__)
+#elif defined __GNUC__ || defined __clang__
# define SAL_DEPRECATED(message) __attribute__((deprecated))
#elif defined(_MSC_VER)
# define SAL_DEPRECATED(message) __declspec(deprecated(message))
@@ -585,7 +587,7 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
@since LibreOffice 3.6
*/
#if defined __cplusplus
-#if defined __GNUC__
+#if defined __GNUC__ || defined __clang__
#define SAL_UNUSED_PARAMETER __attribute__ ((unused))
#else
#define SAL_UNUSED_PARAMETER
@@ -614,7 +616,7 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
/// @cond INTERNAL
-#if defined(__GNUC__)
+#if defined __GNUC__ || defined __clang__
// Macro to try to catch and warn on assignments inside expr.
# define SAL_DETAIL_BOOLEAN_EXPR(expr) \
__extension__ ({ \