aboutsummaryrefslogtreecommitdiffstats
path: root/tests/data/small-server.h
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2025-02-23 23:38:15 +0100
committerSimon Ser <contact@emersion.fr>2025-02-23 23:38:15 +0100
commitdbfa8d784eed0949f3dd50c19a58873b5deb32c6 (patch)
tree555bc750eca4df9ad9ff35ab957830f04a77896b /tests/data/small-server.h
parentForward declarate timespec struct (diff)
downloadwayland-dbfa8d784eed0949f3dd50c19a58873b5deb32c6.tar
wayland-dbfa8d784eed0949f3dd50c19a58873b5deb32c6.tar.gz
wayland-dbfa8d784eed0949f3dd50c19a58873b5deb32c6.tar.bz2
wayland-dbfa8d784eed0949f3dd50c19a58873b5deb32c6.tar.lz
wayland-dbfa8d784eed0949f3dd50c19a58873b5deb32c6.tar.xz
wayland-dbfa8d784eed0949f3dd50c19a58873b5deb32c6.tar.zst
wayland-dbfa8d784eed0949f3dd50c19a58873b5deb32c6.zip
scanner: use separate guards for validator functions
Generated XXX_is_valid() functions for enums are guarded behind the same #define as the enum itself. This worked fine until recently, but since fbd7460737c9 ("scanner: add new enum-header mode") we're also generating enum-only headers. When including the enum-only header first, and then the server header, the validator functions are missing. Define a separate guard to fix this. Signed-off-by: Simon Ser <contact@emersion.fr>
Diffstat (limited to 'tests/data/small-server.h')
-rw-r--r--tests/data/small-server.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/data/small-server.h b/tests/data/small-server.h
index 9cafcd9..743fc8d 100644
--- a/tests/data/small-server.h
+++ b/tests/data/small-server.h
@@ -107,6 +107,10 @@ enum intf_A_foo {
* @ingroup iface_intf_A
*/
#define INTF_A_FOO_DEPRECATED_SINCE_VERSION 2
+#endif /* INTF_A_FOO_ENUM */
+
+#ifndef INTF_A_FOO_ENUM_IS_VALID
+#define INTF_A_FOO_ENUM_IS_VALID
/**
* @ingroup iface_intf_A
* Validate a intf_A foo value.
@@ -131,7 +135,7 @@ intf_A_foo_is_valid(uint32_t value, uint32_t version) {
return false;
}
}
-#endif /* INTF_A_FOO_ENUM */
+#endif /* INTF_A_FOO_ENUM_IS_VALID */
#ifndef INTF_A_BAR_ENUM
#define INTF_A_BAR_ENUM
@@ -154,6 +158,10 @@ enum intf_A_bar {
* @ingroup iface_intf_A
*/
#define INTF_A_BAR_THIRD_SINCE_VERSION 2
+#endif /* INTF_A_BAR_ENUM */
+
+#ifndef INTF_A_BAR_ENUM_IS_VALID
+#define INTF_A_BAR_ENUM_IS_VALID
/**
* @ingroup iface_intf_A
* Validate a intf_A bar value.
@@ -172,7 +180,7 @@ intf_A_bar_is_valid(uint32_t value, uint32_t version) {
valid |= INTF_A_BAR_THIRD;
return (value & ~valid) == 0;
}
-#endif /* INTF_A_BAR_ENUM */
+#endif /* INTF_A_BAR_ENUM_IS_VALID */
/**
* @ingroup iface_intf_A