Add utility macros for clang detection, and deprecation with messages.
commitcab4d74b01320670f57dcf356ff89256f4d2fc12
authorZack Weinberg <zackw@panix.com>
Thu, 28 Apr 2016 15:07:58 +0000 (28 11:07 -0400)
committerZack Weinberg <zackw@panix.com>
Wed, 3 Aug 2016 18:03:46 +0000 (3 14:03 -0400)
tree2a043314a5c820767e04a810eff4ecbad70a5a49
parentbf91be88ea90c1ea888d5646270d66363389ce96
Add utility macros for clang detection, and deprecation with messages.

There are three new macros added to features.h and sys/cdefs.h:

 * __glibc_clang_prereq: just like __GNUC_PREREQ, but for clang.
 * __glibc_clang_has_extension: wraps clang's intrinsic __has_extension.
   Writing "#if defined __clang__ && __has_extension (...)" doesn't work,
   because compilers other than clang will object to the unknown macro
   __has_extension even though they don't need to evaluate it.
   Instead, write "#if __glibc_clang_has_extension (...)".

 * __attribute_deprecated_msg__(msg): like __attribute_deprecated__, but
   if possible, prints a message.

The first two are used to define the third.  The third will be used
in subsequent patches.

* include/features.h (__glibc_clang_prereq): New macro.
* misc/sys/cdefs.h (__glibc_clang_has_extension)
(__attribute_deprecated_msg__): New macros.
ChangeLog
include/features.h
misc/sys/cdefs.h