aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2021-01-22 11:47:22 -0800
committerPaul Eggert2021-01-22 12:02:56 -0800
commitb99ec5d5b11154bafb193ceaaac6976daafe3f82 (patch)
tree4cf3bac2b3686f6b8235c302bcb171cdd45b7cb8 /src
parenta900e641fa1fd765799f12a7f699f768ebfccfe8 (diff)
downloademacs-b99ec5d5b11154bafb193ceaaac6976daafe3f82.tar.gz
emacs-b99ec5d5b11154bafb193ceaaac6976daafe3f82.zip
Work around __has_attribute bug in clang 3.4
* src/conf_post.h (HAS_ATTRIBUTE): * src/emacs-module.h.in (EMACS_ATTRIBUTE_NONNULL): Port to clang 3.4 and earlier.
Diffstat (limited to 'src')
-rw-r--r--src/conf_post.h4
-rw-r--r--src/emacs-module.h.in4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/conf_post.h b/src/conf_post.h
index bd56f29e287..176ab28b21a 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -71,7 +71,9 @@ typedef bool bool_bf;
71 It is used only on arguments like cleanup that are handled here. 71 It is used only on arguments like cleanup that are handled here.
72 This macro should be used only in #if expressions, as Oracle 72 This macro should be used only in #if expressions, as Oracle
73 Studio 12.5's __has_attribute does not work in plain code. */ 73 Studio 12.5's __has_attribute does not work in plain code. */
74#ifdef __has_attribute 74#if (defined __has_attribute \
75 && (!defined __clang_minor__ \
76 || 3 < __clang_major__ + (5 <= __clang_minor__)))
75# define HAS_ATTRIBUTE(a) __has_attribute (__##a##__) 77# define HAS_ATTRIBUTE(a) __has_attribute (__##a##__)
76#else 78#else
77# define HAS_ATTRIBUTE(a) HAS_ATTR_##a 79# define HAS_ATTRIBUTE(a) HAS_ATTR_##a
diff --git a/src/emacs-module.h.in b/src/emacs-module.h.in
index 2989b439109..fe52587c1a5 100644
--- a/src/emacs-module.h.in
+++ b/src/emacs-module.h.in
@@ -51,7 +51,9 @@ information how to write modules and use this header file.
51#if 3 < __GNUC__ + (3 <= __GNUC_MINOR__) 51#if 3 < __GNUC__ + (3 <= __GNUC_MINOR__)
52# define EMACS_ATTRIBUTE_NONNULL(...) \ 52# define EMACS_ATTRIBUTE_NONNULL(...) \
53 __attribute__ ((__nonnull__ (__VA_ARGS__))) 53 __attribute__ ((__nonnull__ (__VA_ARGS__)))
54#elif defined __has_attribute 54#elif (defined __has_attribute \
55 && (!defined __clang_minor__ \
56 || 3 < __clang_major__ + (5 <= __clang_minor__)))
55# if __has_attribute (__nonnull__) 57# if __has_attribute (__nonnull__)
56# define EMACS_ATTRIBUTE_NONNULL(...) \ 58# define EMACS_ATTRIBUTE_NONNULL(...) \
57 __attribute__ ((__nonnull__ (__VA_ARGS__))) 59 __attribute__ ((__nonnull__ (__VA_ARGS__)))