summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2023-03-31 17:44:12 +0200
committerAndre Weissflog <floooh@gmail.com>2023-03-31 17:44:12 +0200
commitdbe397f6ed2f0ecef7f9fe525520b9b25f7b1229 (patch)
treec31a51c26d59cf8716de207e3b5b3de2531f0432
parent18d1b0b21f28d9109b9f764790969b84d70faa34 (diff)
gen_rust.py: special case SAPP_MODIFIER_* constants to u32 (fixes https://github.com/floooh/sokol-rust/issues/5)
-rw-r--r--bindgen/gen_rust.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/bindgen/gen_rust.py b/bindgen/gen_rust.py
index 791486e0..5578d083 100644
--- a/bindgen/gen_rust.py
+++ b/bindgen/gen_rust.py
@@ -133,7 +133,14 @@ prim_defaults = {
}
special_constant_types = {
- "SG_INVALID_ID": "u32"
+ "SG_INVALID_ID": "u32",
+ "SAPP_MODIFIER_SHIFT": "u32",
+ "SAPP_MODIFIER_CTRL": "u32",
+ "SAPP_MODIFIER_ALT": "u32",
+ "SAPP_MODIFIER_SUPER": "u32",
+ "SAPP_MODIFIER_LMB": "u32",
+ "SAPP_MODIFIER_RMB": "u32",
+ "SAPP_MODIFIER_MMB": "u32",
}
struct_types = []
@@ -813,7 +820,7 @@ def gen_module(inp, dep_prefixes):
l("// machine generated, do not edit")
l("")
-
+
l("#![allow(dead_code)]")
l("#![allow(unused_imports)]")
l("")