vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Tue Nov 14 18:22:01 2017 +0200| [a1c3e136c4527c7435f28b9cf579723eaef6bc91] | committer: Rémi Denis-Courmont
Drop broken C99 support > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a1c3e136c4527c7435f28b9cf579723eaef6bc91 --- configure.ac | 2 +- include/vlc_arrays.h | 4 ++-- include/vlc_atomic.h | 2 +- include/vlc_common.h | 13 +------------ modules/access/http/h2frame.h | 2 -- 5 files changed, 5 insertions(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index d78db537c5..255e688e9b 100644 --- a/configure.ac +++ b/configure.ac @@ -43,7 +43,7 @@ AC_SUBST(vlclibdir) dnl dnl Check for tools dnl -AC_PROG_CC_C99 +AC_PROG_CC AC_USE_SYSTEM_EXTENSIONS VLC_PROG_CC_C11 AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.]) diff --git a/include/vlc_arrays.h b/include/vlc_arrays.h index 54665346e0..39b69952ff 100644 --- a/include/vlc_arrays.h +++ b/include/vlc_arrays.h @@ -261,12 +261,12 @@ static inline size_t vlc_array_count( vlc_array_t * p_array ) return p_array->i_count; } -#if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) +#ifndef __cplusplus # define vlc_array_item_at_index(ar, idx) \ _Generic((ar), \ const vlc_array_t *: ((ar)->pp_elems[idx]), \ vlc_array_t *: ((ar)->pp_elems[idx])) -#elif defined (__cplusplus) +#else static inline void *vlc_array_item_at_index( vlc_array_t *ar, size_t idx ) { return ar->pp_elems[idx]; diff --git a/include/vlc_atomic.h b/include/vlc_atomic.h index 39e3347f12..31d1454c29 100644 --- a/include/vlc_atomic.h +++ b/include/vlc_atomic.h @@ -34,7 +34,7 @@ #endif # ifndef __cplusplus -# if (__STDC_VERSION__ >= 201112L) && !defined (__STDC_NO_ATOMICS__) +# if !defined (__STDC_NO_ATOMICS__) /*** Native C11 atomics ***/ # include <stdatomic.h> diff --git a/include/vlc_common.h b/include/vlc_common.h index 7c7c764fd7..925c15fc2e 100644 --- a/include/vlc_common.h +++ b/include/vlc_common.h @@ -470,23 +470,12 @@ struct vlc_common_members * It checks if the compound type actually starts with an embedded * \ref vlc_object_t structure. */ -#if !defined(__cplusplus) && (__STDC_VERSION__ >= 201112L) +#if !defined(__cplusplus) # define VLC_OBJECT(x) \ _Generic((x)->obj, \ struct vlc_common_members: (vlc_object_t *)(&(x)->obj), \ const struct vlc_common_members: (const vlc_object_t *)(&(x)->obj) \ ) -#elif defined (__GNUC__) -# ifndef __cplusplus -# define VLC_OBJECT( x ) \ - __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof__((x)->obj), struct vlc_common_members), \ - (vlc_object_t *)(x), (void)0) -# else -# define VLC_OBJECT( x ) \ - ((vlc_object_t *)(&((x)->obj)) \ - + 0 * __builtin_offsetof(__typeof__(*(x)), obj.object_type)) -# endif #else # define VLC_OBJECT( x ) ((vlc_object_t *)&(x)->obj) #endif diff --git a/modules/access/http/h2frame.h b/modules/access/http/h2frame.h index 182239af09..1b475a325c 100644 --- a/modules/access/http/h2frame.h +++ b/modules/access/http/h2frame.h @@ -124,11 +124,9 @@ void vlc_h2_parse_destroy(struct vlc_h2_parser *); const uint8_t *vlc_h2_frame_data_get(const struct vlc_h2_frame *f, size_t *restrict len); -#if (__STDC_VERSION__ >= 201112L) #define vlc_h2_frame_data_get(f, l) \ _Generic((f), \ const struct vlc_h2_frame *: (vlc_h2_frame_data_get)(f, l), \ struct vlc_h2_frame *: (uint8_t *)(vlc_h2_frame_data_get)(f, l)) -#endif /** @} */ _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
