[vlc-devel] [PATCH 5/8] vlc_list: Don't initialize return value with a compound literal in C++

Hugo Beauzée-Luyssen hugo at beauzee.fr
Thu Dec 3 16:16:18 CET 2020


This isn't standard C++ and fails to build with MSVC
---
 include/vlc_list.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/vlc_list.h b/include/vlc_list.h
index bdd70e3044..2e93734282 100644
--- a/include/vlc_list.h
+++ b/include/vlc_list.h
@@ -213,7 +213,11 @@ struct vlc_list_it vlc_list_it_start(const struct vlc_list *head)
 {
     struct vlc_list *first = head->next;
 
+#ifndef __cplusplus
     return (struct vlc_list_it){ head, first, first->next };
+#else
+    return {head, first, first->next};
+#endif
 }
 
 static inline bool vlc_list_it_continue(const struct vlc_list_it *restrict it)
-- 
2.29.2



More information about the vlc-devel mailing list