michaelforney / swc

a library for making a simple Wayland compositor
MIT License
616 stars 52 forks source link

Unable to include the header to C++ projects #20

Closed johan-bjareholt closed 9 years ago

johan-bjareholt commented 9 years ago

This part is a huge pain

struct swc_window
{
    char * title;
    char * class;

    struct swc_window * parent;
};

Since a variable is named "class", g++ get's confused and cannot include the header.

error: expected unqialified-id before 'class'
    char * class;
              ^

Changing the variable name however might break compability with other projects based on swc, so what should we do? If you're ok with a variable name change, i could do the dull work of changing the variable names in the source code and make a pull request if you want.

michaelforney commented 9 years ago

I would suggest changing it to "app_id" to match the xdg_shell protocol. The API isn't finalized yet, so feel free to send me a pull request.

johan-bjareholt commented 9 years ago

I have a patch available on my testing wm which fixes this. Since #21 still isn't fixed i can't try it out on the newest commit, but it works just fine for me on commit a33ff2c