-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
207 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
From cd10f3ba0d83f34ca978cc4c7a552b72fdd068aa Mon Sep 17 00:00:00 2001 | ||
From: David Tolnay <[email protected]> | ||
Date: Tue, 28 Nov 2023 11:18:39 -0800 | ||
Subject: [PATCH 1/2] Flatten cursor.kind() matching in Item::parse down to one | ||
match | ||
|
||
--- | ||
bindgen/ir/item.rs | 84 ++++++++++++++++++++++------------------------ | ||
1 file changed, 41 insertions(+), 43 deletions(-) | ||
|
||
diff --git a/bindgen/ir/item.rs b/bindgen/ir/item.rs | ||
index 0556452bfa..4f2d361e51 100644 | ||
--- a/third_party/rust/bindgen/ir/item.rs | ||
+++ b/third_party/rust/bindgen/ir/item.rs | ||
@@ -1427,53 +1427,52 @@ | ||
} | ||
} | ||
|
||
- // Guess how does clang treat extern "C" blocks? | ||
- if cursor.kind() == CXCursor_UnexposedDecl { | ||
- Err(ParseError::Recurse) | ||
- } else { | ||
+ match cursor.kind() { | ||
+ // Guess how does clang treat extern "C" blocks? | ||
+ CXCursor_UnexposedDecl => Err(ParseError::Recurse), | ||
+ | ||
// We allowlist cursors here known to be unhandled, to prevent being | ||
// too noisy about this. | ||
- match cursor.kind() { | ||
- CXCursor_MacroDefinition | | ||
- CXCursor_MacroExpansion | | ||
- CXCursor_UsingDeclaration | | ||
- CXCursor_UsingDirective | | ||
- CXCursor_StaticAssert | | ||
- CXCursor_FunctionTemplate => { | ||
- debug!( | ||
- "Unhandled cursor kind {:?}: {:?}", | ||
- cursor.kind(), | ||
- cursor | ||
- ); | ||
- } | ||
- CXCursor_InclusionDirective => { | ||
- let file = cursor.get_included_file_name(); | ||
- match file { | ||
- None => { | ||
- warn!( | ||
- "Inclusion of a nameless file in {:?}", | ||
- cursor | ||
- ); | ||
- } | ||
- Some(filename) => { | ||
- ctx.include_file(filename); | ||
- } | ||
- } | ||
- } | ||
- _ => { | ||
- // ignore toplevel operator overloads | ||
- let spelling = cursor.spelling(); | ||
- if !spelling.starts_with("operator") { | ||
+ CXCursor_MacroDefinition | | ||
+ CXCursor_MacroExpansion | | ||
+ CXCursor_UsingDeclaration | | ||
+ CXCursor_UsingDirective | | ||
+ CXCursor_StaticAssert | | ||
+ CXCursor_FunctionTemplate => { | ||
+ debug!( | ||
+ "Unhandled cursor kind {:?}: {:?}", | ||
+ cursor.kind(), | ||
+ cursor | ||
+ ); | ||
+ Err(ParseError::Continue) | ||
+ } | ||
+ CXCursor_InclusionDirective => { | ||
+ let file = cursor.get_included_file_name(); | ||
+ match file { | ||
+ None => { | ||
warn!( | ||
- "Unhandled cursor kind {:?}: {:?}", | ||
- cursor.kind(), | ||
+ "Inclusion of a nameless file in {:?}", | ||
cursor | ||
); | ||
} | ||
+ Some(filename) => { | ||
+ ctx.include_file(filename); | ||
+ } | ||
} | ||
+ Err(ParseError::Continue) | ||
+ } | ||
+ _ => { | ||
+ // ignore toplevel operator overloads | ||
+ let spelling = cursor.spelling(); | ||
+ if !spelling.starts_with("operator") { | ||
+ warn!( | ||
+ "Unhandled cursor kind {:?}: {:?}", | ||
+ cursor.kind(), | ||
+ cursor | ||
+ ); | ||
+ } | ||
+ Err(ParseError::Continue) | ||
} | ||
- | ||
- Err(ParseError::Continue) | ||
} | ||
} | ||
|
||
|
||
From 2997017b5a3065b83e9d76f0080d6cb99c94c0c1 Mon Sep 17 00:00:00 2001 | ||
From: David Tolnay <[email protected]> | ||
Date: Tue, 28 Nov 2023 11:21:18 -0800 | ||
Subject: [PATCH 2/2] Handle CXCursor_LinkageSpec in Clang 18+ | ||
|
||
--- | ||
bindgen/ir/item.rs | 7 +++++-- | ||
1 file changed, 5 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/bindgen/ir/item.rs b/bindgen/ir/item.rs | ||
index 4f2d361e51..dd587b088b 100644 | ||
--- a/third_party/rust/bindgen/ir/item.rs | ||
+++ b/third_party/rust/bindgen/ir/item.rs | ||
@@ -1433,8 +1433,11 @@ impl Item { | ||
} | ||
|
||
match cursor.kind() { | ||
- // Guess how does clang treat extern "C" blocks? | ||
- CXCursor_UnexposedDecl => Err(ParseError::Recurse), | ||
+ // On Clang 18+, extern "C" is reported accurately as a LinkageSpec. | ||
+ // Older LLVM treat it as UnexposedDecl. | ||
+ CXCursor_LinkageSpec | CXCursor_UnexposedDecl => { | ||
+ Err(ParseError::Recurse) | ||
+ } | ||
|
||
// We allowlist cursors here known to be unhandled, to prevent being | ||
// too noisy about this. | ||
--- a/third_party/rust/bindgen/.cargo-checksum.json.orig 2024-04-12 22:55:53.000000000 +0200 | ||
+++ b/third_party/rust/bindgen/.cargo-checksum.json 2024-04-17 13:45:41.721869437 +0200 | ||
@@ -1 +1 @@ | ||
-{"files":{"Cargo.toml":"ae6de5b309f8bf07c259436b1113ccf405b2d7dd862e1b289bfef47a550956d1","LICENSE":"c23953d9deb0a3312dbeaf6c128a657f3591acee45067612fa68405eaa4525db","build.rs":"4a9c4ac3759572e17de312a9d3f4ced3b6fd3c71811729e5a8d06bfbd1ac8f82","callbacks.rs":"9cbda648159897f93a07dbe90a1ee9ba92e2b020a02bc9725b87db4d025df3b6","clang.rs":"a38d153516c6685b46723010793b2f4e8b16468f3cd3296781dea6e485cd66da","codegen/bitfield_unit.rs":"fddeaeab5859f4e82081865595b7705f5c0774d997df95fa5c655b81b9cae125","codegen/bitfield_unit_tests.rs":"9df86490de5e9d66ccea583dcb686dd440375dc1a3c3cf89a89d5de3883bf28a","codegen/dyngen.rs":"7d727a737c616f7f2d3a07d825be8baad9078b3f35ad96277904559b4534ffcc","codegen/error.rs":"5e308b8c54b68511fc8ea2ad15ddac510172c4ff460a80a265336440b0c9653d","codegen/helpers.rs":"5f24007a09e50db7bd2b49b07100cfed649c7b22232558e28c99c759d5d14152","codegen/impl_debug.rs":"71d8e28873ba2de466f2637a824746963702f0511728037d72ee5670c51194cb","codegen/impl_partialeq.rs":"f4599e32c66179ae515a6518a3e94b686689cf59f7dd9ab618c3fb69f17d2c77","codegen/mod.rs":"25ef86b9dd894b40724d78b99e2743654f09bb427a23ccf5940a620c6408688e","codegen/postprocessing/merge_extern_blocks.rs":"be5c5ff6d3d3d4e940814c4dc77f8d687aa6b053dcfbd2185c09616ba9022bf2","codegen/postprocessing/mod.rs":"d1e8c2864d5194a4cb2f6731c0ef582a55b363df9c4f888c26942ff37f728e1c","codegen/postprocessing/sort_semantically.rs":"3071dd509f2e5d3dfd99cafa6ee19bbacb9fec1c61a0b3f6e284a75c1f2c3db6","codegen/serialize.rs":"b1d8fff0bd9717ee7ca883fd3f376cf7b93adb65dc5bb89ede467b087e985a5f","codegen/struct_layout.rs":"7dfc814d3c914a0c53d8ed031baf543dab1def5959e8ab85220cad69a506383a","deps.rs":"5ee2332fdb10325f3b0a0c6d9ba94e13eb631ef39e955fa958afc3625bdb5448","extra_assertions.rs":"494534bd4f18b80d89b180c8a93733e6617edcf7deac413e9a73fd6e7bc9ced7","features.rs":"af20bd617cce27f6716ab3d61a1c8ddfaa46227f4a0d435b08a19d5f277cf8ba","ir/analysis/derive.rs":"ec514585eb40f0e3306bf3302aec0152a2e95e8dce13a67c36b5f00c0cbb76ef","ir/analysis/has_destructor.rs":"7a82f01e7e0595a31b56f7c398fa3019b3fe9100a2a73b56768f7e6943dcc3ce","ir/analysis/has_float.rs":"58ea1e38a59ef208400fd65d426cb5b288949df2d383b3a194fa01b99d2a87fa","ir/analysis/has_type_param_in_array.rs":"d1b9eb119dc14f662eb9bd1394c859f485479e4912589709cdd33f6752094e22","ir/analysis/has_vtable.rs":"368cf30fbe3fab7190fab48718b948caac5da8c9e797b709488716b919315636","ir/analysis/mod.rs":"0c10d8eeb26d7e6f4ce18e9dfb74ea1f9deff5cd350298aca3dc1041b17c20c4","ir/analysis/sizedness.rs":"944443d6aab35d2dd80e4f5e59176ac1e1c463ba2f0eb25d33f1d95dfac1a6d0","ir/analysis/template_params.rs":"d3cc41041b1c45e0b5be2c9f3f1cc0c2341481b9ff51589cba2428df4e6a1ea9","ir/annotations.rs":"f79de09803a3f3ccb33e366a10a707da98cd00a56ba18312ea927d6c977220a4","ir/comment.rs":"5dcfab0095d967daad9b2927093fce3786b1a2146171580afbf526ba56855e36","ir/comp.rs":"b7b28b96e4206b3215881d814661c63c5dd182f34b1163d54bcedbe85998cb06","ir/context.rs":"a7608f7d3dd607647f2af5f45fc7c09483d2a694f91265bba353a71652e2d419","ir/derive.rs":"e5581852eec87918901a129284b4965aefc8a19394187a8095779a084f28fabe","ir/dot.rs":"2d79d698e6ac59ce032840e62ff11103abed1d5e9e700cf383b492333eeebe1f","ir/enum_ty.rs":"0b612e0b57112068455eee519f894016d0a8f425d6a67b98c56b858f57d99f4a","ir/function.rs":"60407267473d785ea33ac854a70c8ca34749bc868024270992deca68a951f74c","ir/int.rs":"68a86182743ec338d58e42203364dc7c8970cb7ec3550433ca92f0c9489b4442","ir/item.rs":"880c982df0843cbdff38b9f9c3829a2d863a224e4de2260c41c3ac69e9148ad4","ir/item_kind.rs":"7666a1ff1b8260978b790a08b4139ab56b5c65714a5652bbcec7faa7443adc36","ir/layout.rs":"61a0e4250ceab889606973f930f4d692837a13a69ae2579738ff09843fed3d65","ir/mod.rs":"713cd537434567003197a123cbae679602c715e976d22f7b23dafd0826ea4c70","ir/module.rs":"7cae5561bcf84a5c3b1ee8f1c3336a33b7f44f0d5ffe885fb108289983fe763e","ir/objc.rs":"4eecdb754542d78acea27d2f547d18d49164047e6efaff8a8d283d6c2dc9875b","ir/template.rs":"4f0e3736558aa8ec359cd9749dc48f87bfff494dd195a67b39cfee7d8a7542ef","ir/traversal.rs":"0c37a0898801ad39bffc8dddd1ee8baa61bb7cf4f3fdc25c8fdd56b6c96ada65","ir/ty.rs":"ba0d7b16a1080caf4960cc7dea0d0800365da0dd5c6e735d508ec448e87b1d40","ir/var.rs":"ced3496cf0683fef91ce94aa09b0ee37255db8425ea8634d52bd73b1b5c160f6","lib.rs":"0bed6f10b2dd25753a40e6e7fa11239f08c05be414ad264c6d7e2f7a8b71f1b2","log_stubs.rs":"9f974e041e35c8c7e29985d27ae5cd0858d68f8676d1dc005c6388d7d011707f","parse.rs":"ccb2c506f08123708ae673b8216404fb22b4c951330662f9b7140b412b063260","regex_set.rs":"7dcc1ad52194f057ea00e8ebc9c23c465ffa6761eed6ba41560d2d02e03c43a6","time.rs":"8efe317e7c6b5ba8e0865ce7b49ca775ee8a02590f4241ef62f647fa3c22b68e"},"package":"c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4"} | ||
\ No newline at end of file | ||
+{"files":{"Cargo.toml":"ae6de5b309f8bf07c259436b1113ccf405b2d7dd862e1b289bfef47a550956d1","LICENSE":"c23953d9deb0a3312dbeaf6c128a657f3591acee45067612fa68405eaa4525db","build.rs":"4a9c4ac3759572e17de312a9d3f4ced3b6fd3c71811729e5a8d06bfbd1ac8f82","callbacks.rs":"9cbda648159897f93a07dbe90a1ee9ba92e2b020a02bc9725b87db4d025df3b6","clang.rs":"a38d153516c6685b46723010793b2f4e8b16468f3cd3296781dea6e485cd66da","codegen/bitfield_unit.rs":"fddeaeab5859f4e82081865595b7705f5c0774d997df95fa5c655b81b9cae125","codegen/bitfield_unit_tests.rs":"9df86490de5e9d66ccea583dcb686dd440375dc1a3c3cf89a89d5de3883bf28a","codegen/dyngen.rs":"7d727a737c616f7f2d3a07d825be8baad9078b3f35ad96277904559b4534ffcc","codegen/error.rs":"5e308b8c54b68511fc8ea2ad15ddac510172c4ff460a80a265336440b0c9653d","codegen/helpers.rs":"5f24007a09e50db7bd2b49b07100cfed649c7b22232558e28c99c759d5d14152","codegen/impl_debug.rs":"71d8e28873ba2de466f2637a824746963702f0511728037d72ee5670c51194cb","codegen/impl_partialeq.rs":"f4599e32c66179ae515a6518a3e94b686689cf59f7dd9ab618c3fb69f17d2c77","codegen/mod.rs":"25ef86b9dd894b40724d78b99e2743654f09bb427a23ccf5940a620c6408688e","codegen/postprocessing/merge_extern_blocks.rs":"be5c5ff6d3d3d4e940814c4dc77f8d687aa6b053dcfbd2185c09616ba9022bf2","codegen/postprocessing/mod.rs":"d1e8c2864d5194a4cb2f6731c0ef582a55b363df9c4f888c26942ff37f728e1c","codegen/postprocessing/sort_semantically.rs":"3071dd509f2e5d3dfd99cafa6ee19bbacb9fec1c61a0b3f6e284a75c1f2c3db6","codegen/serialize.rs":"b1d8fff0bd9717ee7ca883fd3f376cf7b93adb65dc5bb89ede467b087e985a5f","codegen/struct_layout.rs":"7dfc814d3c914a0c53d8ed031baf543dab1def5959e8ab85220cad69a506383a","deps.rs":"5ee2332fdb10325f3b0a0c6d9ba94e13eb631ef39e955fa958afc3625bdb5448","extra_assertions.rs":"494534bd4f18b80d89b180c8a93733e6617edcf7deac413e9a73fd6e7bc9ced7","features.rs":"af20bd617cce27f6716ab3d61a1c8ddfaa46227f4a0d435b08a19d5f277cf8ba","ir/analysis/derive.rs":"ec514585eb40f0e3306bf3302aec0152a2e95e8dce13a67c36b5f00c0cbb76ef","ir/analysis/has_destructor.rs":"7a82f01e7e0595a31b56f7c398fa3019b3fe9100a2a73b56768f7e6943dcc3ce","ir/analysis/has_float.rs":"58ea1e38a59ef208400fd65d426cb5b288949df2d383b3a194fa01b99d2a87fa","ir/analysis/has_type_param_in_array.rs":"d1b9eb119dc14f662eb9bd1394c859f485479e4912589709cdd33f6752094e22","ir/analysis/has_vtable.rs":"368cf30fbe3fab7190fab48718b948caac5da8c9e797b709488716b919315636","ir/analysis/mod.rs":"0c10d8eeb26d7e6f4ce18e9dfb74ea1f9deff5cd350298aca3dc1041b17c20c4","ir/analysis/sizedness.rs":"944443d6aab35d2dd80e4f5e59176ac1e1c463ba2f0eb25d33f1d95dfac1a6d0","ir/analysis/template_params.rs":"d3cc41041b1c45e0b5be2c9f3f1cc0c2341481b9ff51589cba2428df4e6a1ea9","ir/annotations.rs":"f79de09803a3f3ccb33e366a10a707da98cd00a56ba18312ea927d6c977220a4","ir/comment.rs":"5dcfab0095d967daad9b2927093fce3786b1a2146171580afbf526ba56855e36","ir/comp.rs":"b7b28b96e4206b3215881d814661c63c5dd182f34b1163d54bcedbe85998cb06","ir/context.rs":"a7608f7d3dd607647f2af5f45fc7c09483d2a694f91265bba353a71652e2d419","ir/derive.rs":"e5581852eec87918901a129284b4965aefc8a19394187a8095779a084f28fabe","ir/dot.rs":"2d79d698e6ac59ce032840e62ff11103abed1d5e9e700cf383b492333eeebe1f","ir/enum_ty.rs":"0b612e0b57112068455eee519f894016d0a8f425d6a67b98c56b858f57d99f4a","ir/function.rs":"60407267473d785ea33ac854a70c8ca34749bc868024270992deca68a951f74c","ir/int.rs":"68a86182743ec338d58e42203364dc7c8970cb7ec3550433ca92f0c9489b4442","ir/item.rs":"239b3e4d20498f69ed5f94481ed932340bd58cb485b26c35b09517f249d20d11","ir/item_kind.rs":"7666a1ff1b8260978b790a08b4139ab56b5c65714a5652bbcec7faa7443adc36","ir/layout.rs":"61a0e4250ceab889606973f930f4d692837a13a69ae2579738ff09843fed3d65","ir/mod.rs":"713cd537434567003197a123cbae679602c715e976d22f7b23dafd0826ea4c70","ir/module.rs":"7cae5561bcf84a5c3b1ee8f1c3336a33b7f44f0d5ffe885fb108289983fe763e","ir/objc.rs":"4eecdb754542d78acea27d2f547d18d49164047e6efaff8a8d283d6c2dc9875b","ir/template.rs":"4f0e3736558aa8ec359cd9749dc48f87bfff494dd195a67b39cfee7d8a7542ef","ir/traversal.rs":"0c37a0898801ad39bffc8dddd1ee8baa61bb7cf4f3fdc25c8fdd56b6c96ada65","ir/ty.rs":"ba0d7b16a1080caf4960cc7dea0d0800365da0dd5c6e735d508ec448e87b1d40","ir/var.rs":"ced3496cf0683fef91ce94aa09b0ee37255db8425ea8634d52bd73b1b5c160f6","lib.rs":"0bed6f10b2dd25753a40e6e7fa11239f08c05be414ad264c6d7e2f7a8b71f1b2","log_stubs.rs":"9f974e041e35c8c7e29985d27ae5cd0858d68f8676d1dc005c6388d7d011707f","parse.rs":"ccb2c506f08123708ae673b8216404fb22b4c951330662f9b7140b412b063260","regex_set.rs":"7dcc1ad52194f057ea00e8ebc9c23c465ffa6761eed6ba41560d2d02e03c43a6","time.rs":"8efe317e7c6b5ba8e0865ce7b49ca775ee8a02590f4241ef62f647fa3c22b68e"},"package":"c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4"} | ||
diff --git a/dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp b/dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp | ||
--- a/dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp | ||
+++ b/dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp | ||
@@ -97,11 +97,11 @@ | ||
uint32_t width_; | ||
uint32_t height_; | ||
uint8_t y_; | ||
uint8_t u_; | ||
uint8_t v_; | ||
- uint32_t timestamp_; | ||
+ uint64_t timestamp_; | ||
} idr_nalu; | ||
}; | ||
#pragma pack(pop) | ||
|
||
#define ENCODED_FRAME_MAGIC 0x004000b8 | ||
diff --git a/dom/media/gtest/TestGMPRemoveAndDelete.cpp b/dom/media/gtest/TestGMPRemoveAndDelete.cpp | ||
--- a/dom/media/gtest/TestGMPRemoveAndDelete.cpp | ||
+++ b/dom/media/gtest/TestGMPRemoveAndDelete.cpp | ||
@@ -359,11 +359,11 @@ | ||
uint32_t width_; | ||
uint32_t height_; | ||
uint8_t y_; | ||
uint8_t u_; | ||
uint8_t v_; | ||
- uint32_t timestamp_; | ||
+ uint64_t timestamp_; | ||
} idr_nalu; | ||
}; | ||
#pragma pack(pop) | ||
|
||
GMPVideoFrame* absFrame; | ||
diff --git a/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h b/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h | ||
--- a/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h | ||
+++ b/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h | ||
@@ -300,11 +300,11 @@ | ||
|
||
struct InputImageData { | ||
int64_t timestamp_us; | ||
}; | ||
// Map rtp time -> input image data | ||
- DataMutex<std::map<uint32_t, InputImageData>> mInputImageMap; | ||
+ DataMutex<std::map<uint64_t, InputImageData>> mInputImageMap; | ||
|
||
MediaEventProducer<uint64_t> mInitPluginEvent; | ||
MediaEventProducer<uint64_t> mReleasePluginEvent; | ||
}; | ||
|
||
diff --git a/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp b/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp | ||
--- a/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp | ||
+++ b/dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp | ||
@@ -538,11 +538,11 @@ | ||
return; | ||
} | ||
|
||
webrtc::VideoFrameType ft; | ||
GmpFrameTypeToWebrtcFrameType(aEncodedFrame->FrameType(), &ft); | ||
- uint32_t timestamp = (aEncodedFrame->TimeStamp() * 90ll + 999) / 1000; | ||
+ uint64_t timestamp = (aEncodedFrame->TimeStamp() * 90ll + 999) / 1000; | ||
|
||
GMP_LOG_DEBUG("GMP Encoded: %" PRIu64 ", type %d, len %d", | ||
aEncodedFrame->TimeStamp(), aEncodedFrame->BufferType(), | ||
aEncodedFrame->Size()); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters