Skip to content
Snippets Groups Projects
Commit f4cf30a8 authored by James Le Cuirot's avatar James Le Cuirot Committed by Hans Verkuil
Browse files

v4l2-compliance: Fix building against libc++


v4l2-test-time32-64.cpp included compiler.h, which checks
_LIBCPP_VERSION. This only works against libc++ when a C++ header has
already been included, which wasn't the case here.

The <version> header is the C++20 method of defining _LIBCPP_VERSION,
but for older versions, <ciso646> works as an alternative, so include
that in compiler.h.

compiler.h is for C as well as C++ though, so use __cplusplus to check
for a C++ compiler before including <ciso646>.

Signed-off-by: default avatarJames Le Cuirot <chewi@gentoo.org>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 7d55dd43
No related branches found
No related tags found
No related merge requests found
#ifdef _LIBCPP_VERSION #if !defined(__cplusplus) || __cplusplus < 201103L
#define fallthrough _LIBCPP_FALLTHROUGH() #define fallthrough ((void)0)
#else #else
#include <ciso646>
#if __cplusplus >= 201103L #ifdef _LIBCPP_VERSION
#define fallthrough _LIBCPP_FALLTHROUGH()
#ifdef __clang__ #else
#define fallthrough [[clang::fallthrough]] #ifdef __clang__
#else #define fallthrough [[clang::fallthrough]]
#define fallthrough [[gnu::fallthrough]] #else
#endif // __clang__ #define fallthrough [[gnu::fallthrough]]
#endif // __clang__
#else #endif // _LIBCPP_VERSION
#define fallthrough ((void)0)
#endif // __cplusplus #endif // __cplusplus
#endif // _LIBCPP_VERSION
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment