mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
scanner: Generate all SINCE_VERSION macros for everyone
Practical example: a client supporting version 2 of wl_output will wait for the wl_output.done event before starting wl_output-related operations. However, if the server only supports version 1, no event will ever come, and it must fallback to use the wl_output.geometry event alone. Without this macro, it cannot check for that in a nice way. This patch introduces the same #defines in both server and client headers. We rely on both being generated from the same XML file and https://gcc.gnu.org/onlinedocs/cpp/Undefining-and-Redefining-Macros.html to not cause compiler errors or warning due to redefinitions. We also assume that no-one uses the same name in the same interface for both a request and an event. If this patch does cause grief due to identical redefinitions, the contingency plan is to change the generator to produce #ifndef/#define/#endif instead of just #define. Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> [Pekka: add paragraphs to commit message.]
This commit is contained in:
parent
bad9dc5186
commit
5636cb2f05
1 changed files with 2 additions and 0 deletions
|
|
@ -1554,10 +1554,12 @@ emit_header(struct protocol *protocol, enum side side)
|
|||
emit_structs(&i->request_list, i, side);
|
||||
emit_opcodes(&i->event_list, i);
|
||||
emit_opcode_versions(&i->event_list, i);
|
||||
emit_opcode_versions(&i->request_list, i);
|
||||
emit_event_wrappers(&i->event_list, i);
|
||||
} else {
|
||||
emit_structs(&i->event_list, i, side);
|
||||
emit_opcodes(&i->request_list, i);
|
||||
emit_opcode_versions(&i->event_list, i);
|
||||
emit_opcode_versions(&i->request_list, i);
|
||||
emit_stubs(&i->request_list, i);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue