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

Ben Martin monkeyiq at users.sourceforge.net
Fri Mar 10 15:09:53 EST 2006


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. 

Sorry I didn't mention this as the initially proposed solution :/

    struct foo 
    {
        char* a;
#ifdef __cplusplus
        int _class;
#else
        int class;
#endif
    };

int main( int, char** )
{
    return -1;
}

$ g++ extern_c_bad_decl.cpp -o extern_c_bad_decl
$ gcc extern_c_bad_decl.cpp -o extern_c_bad_declc


On Fri, 2006-03-10 at 12:15 +1100, Silvia.Pfeiffer at csiro.au wrote:
> Hmm, I guess I'll have to make another libcmml release with incompatible
> API. :(
> Thanks!
> S.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://lists.annodex.net/archives/libannodex-dev/attachments/20060310/ce75c3bc/attachment.pgp


More information about the libannodex-dev mailing list