Browse Source

vlc_fixup: fix usage of typeof from C++

Replace typeof by a decltype()-based equivalent on compilers not
supporting typeof.

Decltype is not equivalent to typeof, but we are mostly concerned about
removing references from the type, since it has no use in C code like
VLC list.

Note that this fixup is there to fix the usage of headers using typeof
in C++ code, not to provide "typeof" directly C++ to replace decltype.
pull/136/head
Alexandre Janniaux 4 years ago
committed by Hugo Beauzée-Luyssen
parent
commit
bd8f233b0c
  1. 7
      include/vlc_fixups.h

7
include/vlc_fixups.h

@ -684,4 +684,11 @@ int clock_nanosleep(clockid_t clock_id, int flags,
} /* extern "C" */
#endif
#if defined(__cplusplus)
#ifndef HAVE_CXX_TYPEOF
# include <type_traits>
# define typeof(t) std::remove_reference<decltype(t)>::type
#endif
#endif
#endif /* !LIBVLC_FIXUPS_H */

Loading…
Cancel
Save