From 0f62aed1a1118c6817bd0544403567a104afef53 Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Sun, 23 Jan 2011 12:21:15 +0100 Subject: [PATCH] Guard enums in generated wayland-*-protocol.h (krh: edit #define guard to use WL_ prefix) --- wayland/scanner.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wayland/scanner.c b/wayland/scanner.c index 91054b7d..43e6fa3f 100644 --- a/wayland/scanner.c +++ b/wayland/scanner.c @@ -470,13 +470,19 @@ emit_enumerations(struct interface *interface) struct entry *entry; wl_list_for_each(e, &interface->enumeration_list, link) { + printf("#ifndef WL_%s_%s_ENUM\n", + interface->uppercase_name, e->uppercase_name); + printf("#define WL_%s_%s_ENUM\n", + interface->uppercase_name, e->uppercase_name); printf("enum wl_%s_%s {\n", interface->name, e->name); wl_list_for_each(entry, &e->entry_list, link) printf("\tWL_%s_%s_%s = %s,\n", interface->uppercase_name, e->uppercase_name, entry->uppercase_name, entry->value); - printf("};\n\n"); + printf("};\n"); + printf("#endif /* WL_%s_%s_ENUM */\n\n", + interface->uppercase_name, e->uppercase_name); } }