[waffle] [PATCH 01/17] include: Define macro WAFFLE_DEPRECATED_1_06

Chad Versace chad.versace at intel.com
Tue Jan 20 10:50:42 PST 2015


On 01/15/2015 04:29 AM, Emil Velikov wrote:
> On 4 January 2015 at 22:02, Chad Versace <chad.versace at intel.com> wrote:
>> This macro annotates symbols as deprecated in Waffle 1.6. The compiler
>> emits deprecation warnings only if the user enables the feature macro
>> for the Waffle 1.6 API.
>>
>> Signed-off-by: Chad Versace <chad.versace at intel.com>
>> ---
>>  include/waffle/waffle.h | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/include/waffle/waffle.h b/include/waffle/waffle.h
>> index e04b23f..afec630 100644
>> --- a/include/waffle/waffle.h
>> +++ b/include/waffle/waffle.h
>> @@ -36,6 +36,18 @@
>>  extern "C" {
>>  #endif
>>
>> +#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)
>> +#    define WAFFLE_DEPRECATED __attribute__((deprecated))
> For MSVC one can use the following. Although I'm thinking that the
> compiler will complain as the function declaration will differ from
> the definition.

If I change the definition of WAFFLE_DEPRECATED as you suggest, and
also annotate the function definitions, will that eliminate the MSVC
warnings?

> #elif defined(_MSC_VER)
> #    define WAFFLE_DEPRECATED __declspec(deprecated)
> 
> Adding MSVC compat can be left as a follow up if you prefer.

I prefer to extend the WAFFLE_DEPRECATED for MSVC in a follow-up
patch. It shouldn't cause any trouble to defer it a little bit.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/waffle/attachments/20150120/99ed498b/attachment.sig>


More information about the waffle mailing list