[Xcb] [PATCH v2] c_client.py: avoid field name clash with C++ 'explicit' keyword

Klemens Baum klemensbaum at gmail.com
Mon Dec 28 16:46:10 PST 2015


On Mon, Dec 28, 2015 at 8:14 PM, Keith Packard <keithp at keithp.com> wrote:
>
> Why not just leave the C names alone and use the new names when included
> in a c++ file? You've already accepted a different API for C/C++, after all.

That's certainly an option, but it would mean that C code using XCB
would not compile with a C++ compiler.
It may also create confusion for users because of the inconsistency
with class, new and delete already having the underscore in the C
version but explicit only being prefixed in C++ mode.

That said, if we want to do that, it's simply a matter of changing the
definition of XCB_ALTERNATIVE_NAMES to `type c_name' in the #else part
of the '#ifdef __cplusplus` and moving the three already-prefixed
keywords from _cplusplus_annoyances to _c_keywords.


More information about the Xcb mailing list