vlc/vlc-3.0 | branch: master | Thomas Guillem <tho...@gllm.fr> | Fri Apr 30 14:53:47 2021 +0200| [6f160ae1784364aa9324f9cfcb7fbda592cc3dd9] | committer: Thomas Guillem
smb2: fix build with libsmb2 3.0.0 Fixes #25680 > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=6f160ae1784364aa9324f9cfcb7fbda592cc3dd9 --- modules/access/smb2.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/modules/access/smb2.c b/modules/access/smb2.c index 6575de42d2..7d44854655 100644 --- a/modules/access/smb2.c +++ b/modules/access/smb2.c @@ -133,6 +133,34 @@ smb2_set_error(stream_t *access, const char *psz_func, int err) #define VLC_SMB2_STATUS_DENIED(x) (x == -ECONNREFUSED || x == -EACCES) +#if defined (__ELF__) || defined (__MACH__) /* weak support */ +/* There is no way to know if libsmb2 has these new symbols and we don't want + * to increase the version requirement on VLC 3.0, therefore implement a weak + * compat version. */ +const t_socket * +smb2_get_fds(struct smb2_context *smb2, size_t *fd_count, int *timeout); +int +smb2_service_fd(struct smb2_context *smb2, int fd, int revents); + +__attribute__((weak)) const t_socket * +smb2_get_fds(struct smb2_context *smb2, size_t *fd_count, int *timeout) +{ + (void) timeout; + static thread_local t_socket fd; + + *fd_count = 1; + fd = smb2_get_fd(smb2); + return &fd; +} + +__attribute__((weak)) int +smb2_service_fd(struct smb2_context *smb2, int fd, int revents) +{ + (void) fd; + return smb2_service(smb2, revents); +} +#endif + static int vlc_smb2_mainloop(stream_t *access, bool teardown) { _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits