[libannodex-dev] C++ clients and the use of 'class' asstructmember names.

Jamie Wilkinson jaq at spacepants.org
Sat Mar 11 10:11:13 EST 2006


This one time, at band camp, David Kuehling wrote:
>>>>>> "Ben" == Ben Martin <monkeyiq at users.sourceforge.net> writes:
>
>> One option would be to ifdef guard the "class" member. This shouldn't
>> break API because it would only come into effect if you are compiling
>> with C++ which is not currently cleanly possible.
>
>> As there are only a handful of "class" members this doesn't really
>> pollute the header too much and you retain full compatibility with
>> your C clients.
>
>Well, why not do 
>
>#ifdef __cplusplus
>    #define class _class
>#endif
>
>At the start of the header file, and
>
>#undef class
>
>at the end?

All these suggestions smell like dirty hacks, I'd just bite the bullet and
make the API change, document it in the ChangeLog and NEWS and bump the
soname.



More information about the libannodex-dev mailing list