Skip to content

Commit

Permalink
Add sc_vector
Browse files Browse the repository at this point in the history
Adapt vlc_vector [1], that I initially wrote while implementing the VLC
playlist [2].

Change the implementation to use "statement expressions" [3], which are
forbidden in VLC because "non-standard", but:
 - they are supported by gcc and clang;
 - they are already used in the scrcpy codebase;
 - they avoid implementation hacks (VLC_VECTOR_FAILFLAG_);
 - they allow a better API (sc_vector_index_of() may return the result
   without an output parameter).

PR #3035 <#3035>

[1]: https://code.videolan.org/videolan/vlc/-/blob/0857947abaed9c89810cd96353aaa1b7e6ba3b0d/include/vlc_vector.h
[2]: https://blog.rom1v.com/2019/05/a-new-core-playlist-for-vlc-4
[3]: https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html
  • Loading branch information
rom1v committed Feb 20, 2022
1 parent 36c75e1 commit c070723
Show file tree
Hide file tree
Showing 3 changed files with 963 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ if get_option('buildtype') == 'debug'
'src/util/str.c',
'src/util/strbuf.c',
]],
['test_vector', [
'tests/test_vector.c',
]],
]

foreach t : tests
Expand Down
Loading

0 comments on commit c070723

Please sign in to comment.