summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2019-12-14 21:52:49 +0000
committerConrad Meyer <cem@FreeBSD.org>2019-12-14 21:52:49 +0000
commit215332ffe75cf16b742e2b74dfefd0592c49eb63 (patch)
treeb3aefe232af6b2e333923b60287818ef992a7162 /include
parent547a4dba9f7627ddf918af6fe8a64fdddfd6bdf8 (diff)
downloadsrc-test2-215332ffe75cf16b742e2b74dfefd0592c49eb63.tar.gz
src-test2-215332ffe75cf16b742e2b74dfefd0592c49eb63.zip
cdefs: Add __deprecated(message) function attribute macro
The legacy version of GCC4 currently in base does not support the parameterized form of this function attribute, as recent introduced in stdlib.h (r355747). As we have done for other function attributes with similar compatibility problems, add a version-compatibile definition in sys/cdefs.h. Note that Clang defines itself to be GCC 4, so one must check for __clang__ in addition to __GNUC__ version. On legacy GCC 4, the macro expands to just the __deprecated__ attribute; on modern GCC or Clang, the macro expands to the parameterized variant with the message. Ignoring legacy or unsupported compilers, the macro is also beneficial in that it is a bit more ergonomic than the full __attribute__((__deprecated__())) boilerplate. Reported by: CI (but not tinderbox); imp and others Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D22817
Notes
Notes: svn path=/head/; revision=355759
Diffstat (limited to 'include')
-rw-r--r--include/stdlib.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index 50bda707a0d3..e46e473fabc4 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -315,7 +315,7 @@ long long
/* Deprecated interfaces, to be removed. */
static inline void
-__attribute__((__deprecated__("sranddev to be removed in FreeBSD 13")))
+__deprecated("sranddev to be removed in FreeBSD 13")
sranddev(void)
{
}