Skip to content
Commit 5636cb2f authored by Quentin Glidic's avatar Quentin Glidic Committed by Pekka Paalanen
Browse files

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: default avatarQuentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
[Pekka: add paragraphs to commit message.]
parent bad9dc51
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment