Work around build failure with newer cbindgen. bz#1773259
authorMike Hommey <mh@glandium.org>
Tue, 28 Jun 2022 22:30:11 +0000 (07:30 +0900)
committerMike Hommey <glandium@debian.org>
Tue, 28 Jun 2022 21:30:12 +0000 (22:30 +0100)
Gbp-Pq: Topic debian-hacks
Gbp-Pq: Name Work-around-build-failure-with-newer-cbindgen.-bz-17.patch

build/moz.configure/bindgen.configure
gfx/webrender_bindings/webrender_ffi.h

index 73e590a397ea93925ad4b798bfe9f0fbbb23429c..3679fddbaec2c6ea7381b221a1b1067eba240986 100644 (file)
@@ -91,6 +91,15 @@ def cbindgen(cbindgen_override, bootstrap_search_path, rust_search_path):
 
 set_config("CBINDGEN", cbindgen)
 
+set_define(
+    "CBINDGEN_0_24",
+    True,
+    when=depends(cbindgen)(
+        lambda c: Version(check_cmd_output(c, "--version").strip().split(" ")[1])
+        >= "0.24.0"
+    ),
+)
+
 # Bindgen can use rustfmt to format Rust file, but it's not required.
 option(env="RUSTFMT", nargs=1, help="Path to the rustfmt program")
 
index b68b691b6e9eec0a8587cd74c0e49a7540401ec1..e8378244b51b6a763d15ddcc6f9e8da5c582a052 100644 (file)
@@ -77,7 +77,9 @@ struct WrPipelineInfo;
 struct WrPipelineIdAndEpoch;
 using WrPipelineIdEpochs = nsTArray<WrPipelineIdAndEpoch>;
 
+#ifndef CBINDGEN_0_24
 const uint64_t ROOT_CLIP_CHAIN = ~0;
+#endif
 
 }  // namespace wr
 }  // namespace mozilla