diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-05-03 15:06:58 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-05-03 15:10:07 -0700 |
commit | 106936415d2892fc373842b3aedd805096fc9e0e (patch) | |
tree | 5ca481999c2722c21eaa03711b5d65173735a619 /src/systhread.h | |
parent | 6bd47f4477904a55fc08345394bfab9cd7eae2eb (diff) | |
download | emacs-106936415d2892fc373842b3aedd805096fc9e0e.tar.gz emacs-106936415d2892fc373842b3aedd805096fc9e0e.tar.bz2 emacs-106936415d2892fc373842b3aedd805096fc9e0e.zip |
Simplify by using attribute.h macros
attribute.h is partly designed for C2X forward compatibility,
since C2X will add some standard attributes. Using its macros
should help insulate Emacs from C2X teething problems.
* src/conf_post.h: Include attribute.h.
(HAS_ATTRIBUTE, HAS_FEATURE): Rename from __has_attribute and
__has_feature, to avoid polluting the builtin namespace.
All uses changed.
(ATTRIBUTE_COLD, ATTRIBUTE_FORMAT, FALLTHROUGH, ATTRIBUTE_CONST)
(ATTRIBUTE_PURE, ATTRIBUTE_UNUSED, ATTRIBUTE_MAY_ALIAS)
(ATTRIBUTE_MALLOC, ATTRIBUTE_ALLOC_SIZE)
(ATTRIBUTE_RETURNS_NONNULL): Remove, as attribute.h does this now.
(NO_INLINE, EXTERNALLY_VISIBLE, ARG_NONNULL, ATTRIBUTE_UNUSED):
Simplify by defining in terms of attribute.h macros.
* src/systhread.h (ATTRIBUTE_WARN_UNUSED_RESULT): Remove.
All uses replaced by attribute.h’s NODISCARD.
Diffstat (limited to 'src/systhread.h')
-rw-r--r-- | src/systhread.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/systhread.h b/src/systhread.h index 005388fd5a4..73c764a9401 100644 --- a/src/systhread.h +++ b/src/systhread.h @@ -21,12 +21,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #include <stdbool.h> -#if __has_attribute (warn_unused_result) -# define ATTRIBUTE_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result)) -#else -# define ATTRIBUTE_WARN_UNUSED_RESULT -#endif - #ifdef THREADS_ENABLED #ifdef HAVE_PTHREAD @@ -108,13 +102,13 @@ extern void sys_cond_broadcast (sys_cond_t *); extern void sys_cond_destroy (sys_cond_t *); extern sys_thread_t sys_thread_self (void) - ATTRIBUTE_WARN_UNUSED_RESULT; + NODISCARD; extern bool sys_thread_equal (sys_thread_t, sys_thread_t) - ATTRIBUTE_WARN_UNUSED_RESULT; + NODISCARD; extern bool sys_thread_create (sys_thread_t *, thread_creation_function *, void *) - ATTRIBUTE_WARN_UNUSED_RESULT; + NODISCARD; extern void sys_thread_yield (void); extern void sys_thread_set_name (const char *); |