Commit a1c3e136 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Drop broken C99 support

parent b97304c1
......@@ -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.])
......
......@@ -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];
......
......@@ -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>
......
......@@ -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
......
......@@ -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
/** @} */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment