From 59678ec0b489d86f6f62cc987e21a82346f8da42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Mon, 22 Jun 2015 15:51:11 +0200 Subject: [PATCH] Fix warning on all c++ files Since vlc_atomic_float is only used for C files, another option would be to disable this block when building in C++ mode. Related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64658 --- include/vlc_atomic.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/vlc_atomic.h b/include/vlc_atomic.h index 72590c8c5b..a65239116d 100644 --- a/include/vlc_atomic.h +++ b/include/vlc_atomic.h @@ -115,7 +115,12 @@ static inline void vlc_atomic_init_float(vlc_atomic_float *var, float f) { union { float f; uint32_t i; } u; u.f = f; +#if defined(__cplusplus) && defined(HAVE_CXX11) + vlc_atomic_float a(u.i) + *var = a; +#else atomic_init(var, u.i); +#endif } /** Helper to retrieve a single precision from an atom. */