Re: [PATCH 3/4] Add a macro to get the opcode number of a request given the interface

2014-05-20 Thread Neil Roberts
Jason Ekstrand writes: > Ooh, I like this. I thought about having wayland-scanner emit more > #defines, but this works rather nicely. One question: do we want it in > wayland-util or wayland-server? Putting it in wayland-util exposes it > client-side as well. > --Jason Yeah, I agree, perhaps

Re: [PATCH 3/4] Add a macro to get the opcode number of a request given the interface

2014-05-19 Thread Jason Ekstrand
Ooh, I like this. I thought about having wayland-scanner emit more #defines, but this works rather nicely. One question: do we want it in wayland-util or wayland-server? Putting it in wayland-util exposes it client-side as well. --Jason On Mon, May 19, 2014 at 12:26 PM, Neil Roberts wrote: >

[PATCH 3/4] Add a macro to get the opcode number of a request given the interface

2014-05-19 Thread Neil Roberts
This adds a macro called WL_REQUEST_OPCODE which takes the name of the struct for the interface and the name of one of its members. It then calculates the opcode number by dividing the offsetof the member by the size of a function pointer. This assumes the interface struct only contains function po