[Libreoffice-commits] core.git: include/sal
Miklos Vajna
vmiklos at collabora.co.uk
Wed Aug 9 08:29:39 UTC 2017
include/sal/types.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit a0e0b8372920e24672bb199e8e697fbc1cb8f5f2
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Aug 9 08:55:07 2017 +0200
SAL_RETURNS_NONNULL: handle old clang not understanding returns_nonnull attr
Seen on the macOS baseline.
Change-Id: Ibfd4a848b2f31bb782a83c523c72ccf7de4e0e6d
Reviewed-on: https://gerrit.libreoffice.org/40902
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/include/sal/types.h b/include/sal/types.h
index 52066bf40f7d..a138a90858df 100644
--- a/include/sal/types.h
+++ b/include/sal/types.h
@@ -707,7 +707,11 @@ inline char16_t const * SAL_U(wchar_t const * p)
@since LibreOffice 5.5
*/
-#if defined LIBO_INTERNAL_ONLY && ((defined __GNUC__ && __GNUC__ > 4) || defined __clang__)
+#ifndef __has_attribute
+#define __has_attribute(x) 0
+#endif
+
+#if defined LIBO_INTERNAL_ONLY && ((defined __GNUC__ && __GNUC__ > 4) || (defined __clang__ && __has_attribute(returns_nonnull)))
#define SAL_RETURNS_NONNULL __attribute__((returns_nonnull))
#else
#define SAL_RETURNS_NONNULL
More information about the Libreoffice-commits
mailing list