Skip to content

Commit

Permalink
is_pod is deprecated in cxx 20
Browse files Browse the repository at this point in the history
  • Loading branch information
roxanneskelly committed Sep 9, 2023
1 parent 4df96cc commit f592b7a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
55 changes: 55 additions & 0 deletions build/patches/is_pod-is-deprecated.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
diff --git a/modules/video_coding/include/video_codec_interface.h b/modules/video_coding/include/video_codec_interface.h
index 46ae0d29e1..fa4cb0e241 100644
--- a/modules/video_coding/include/video_codec_interface.h
+++ b/modules/video_coding/include/video_codec_interface.h
@@ -51,7 +51,7 @@ struct CodecSpecificInfoVP8 {
size_t updatedBuffers[kBuffersCount];
size_t updatedBuffersCount;
};
-static_assert(std::is_pod<CodecSpecificInfoVP8>::value, "");
+static_assert( std::is_trivial<CodecSpecificInfoVP8>::value && std::is_standard_layout<CodecSpecificInfoVP8>::value, "");

// Hack alert - the code assumes that thisstruct is memset when constructed.
struct CodecSpecificInfoVP9 {
@@ -82,7 +82,7 @@ struct CodecSpecificInfoVP9 {

ABSL_DEPRECATED("") bool end_of_picture;
};
-static_assert(std::is_pod<CodecSpecificInfoVP9>::value, "");
+static_assert( std::is_trivial<CodecSpecificInfoVP9>::value && std::is_standard_layout<CodecSpecificInfoVP9>::value, "");

// Hack alert - the code assumes that thisstruct is memset when constructed.
struct CodecSpecificInfoH264 {
@@ -91,14 +91,14 @@ struct CodecSpecificInfoH264 {
bool base_layer_sync;
bool idr_frame;
};
-static_assert(std::is_pod<CodecSpecificInfoH264>::value, "");
+static_assert( std::is_trivial<CodecSpecificInfoH264>::value && std::is_standard_layout<CodecSpecificInfoH264>::value, "");

union CodecSpecificInfoUnion {
CodecSpecificInfoVP8 VP8;
CodecSpecificInfoVP9 VP9;
CodecSpecificInfoH264 H264;
};
-static_assert(std::is_pod<CodecSpecificInfoUnion>::value, "");
+static_assert( std::is_trivial<CodecSpecificInfoUnion>::value && std::is_standard_layout<CodecSpecificInfoUnion>::value, "");

// Note: if any pointers are added to this struct or its sub-structs, it
// must be fitted with a copy-constructor. This is because it is copied
diff --git a/test/fuzzers/rtp_frame_reference_finder_fuzzer.cc b/test/fuzzers/rtp_frame_reference_finder_fuzzer.cc
index b1cabc31ac..4a9e528560 100644
--- a/test/fuzzers/rtp_frame_reference_finder_fuzzer.cc
+++ b/test/fuzzers/rtp_frame_reference_finder_fuzzer.cc
@@ -23,7 +23,7 @@ class DataReader {

template <typename T>
void CopyTo(T* object) {
- static_assert(std::is_pod<T>(), "");
+ static_assert(std::is_trivial<T>() && std::is_standard_layout<T>(), "");
uint8_t* destination = reinterpret_cast<uint8_t*>(object);
size_t object_size = sizeof(T);
size_t num_bytes = std::min(size_ - offset_, object_size);
--


3 changes: 3 additions & 0 deletions build/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,21 @@ def get_depot_tools(source_dir, fetch=False):
'windows_add_deps.patch',
'windows_silence_warnings.patch',
'fix_mocks.patch',
'is_pod-is-deprecated.patch',
],
'windows_x86': [
'add_license_dav1d.patch',
'windows_add_deps.patch',
'windows_silence_warnings.patch',
'fix_mocks.patch',
'is_pod-is-deprecated.patch',
],
'windows_arm64': [
'add_license_dav1d.patch',
'windows_add_deps.patch',
'windows_silence_warnings.patch',
'fix_mocks.patch',
'is_pod-is-deprecated.patch',
],
'macos_x86_64': [
'add_license_dav1d.patch',
Expand Down

0 comments on commit f592b7a

Please sign in to comment.