aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2023-04-27 17:42:11 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-04-29 17:01:52 +0200
commit0ab341b247fc1c2cd101a87c78f38d2da00c335c (patch)
treeee9be1053d62b23306d6bdd7fe78fcb874f02435 /misc
parentf56ad6174c62aa38f7edf68167d620482b776dc9 (diff)
downloadglibc-0ab341b247fc1c2cd101a87c78f38d2da00c335c.zip
glibc-0ab341b247fc1c2cd101a87c78f38d2da00c335c.tar.gz
glibc-0ab341b247fc1c2cd101a87c78f38d2da00c335c.tar.bz2
cdefs.h: Define __COLD
This expands to __attribute__ ((cold)) when supported. It should be used to mark up functions that are invoked rarely. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Diffstat (limited to 'misc')
-rw-r--r--misc/sys/cdefs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 23ec0eb..9a07e29 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -98,6 +98,12 @@
# endif
# endif
+# if __GNUC_PREREQ (4, 3) || __glibc_has_attribute (__cold__)
+# define __COLD __attribute__ ((__cold__))
+# else
+# define __COLD
+# endif
+
#else /* Not GCC or clang. */
# if (defined __cplusplus \
@@ -110,6 +116,7 @@
# define __THROW
# define __THROWNL
# define __NTH(fct) fct
+# define __COLD
#endif /* GCC || clang. */