[vlc-devel] [RFC PATCH] DASH using cinttypes: build issues
Thomas Guillem
thomas at gllm.fr
Wed Jan 14 11:56:47 CET 2015
In CPP, PRId64 macros needs <cinttypes> that is c++11 only.
I enabled -std=c++11 for android build, but then I had some issues with
vlc_fixups.h: static_assert is already defined in c++11.
It's hard to fix it in configure.ac, since for android, C11 doesn't have
static_assert while C++11 has it.
We can also remove PRId64 since it's used for debug (for now).
(This patch is not mean to be merged)
---
include/vlc_fixups.h | 4 ++++
modules/demux/dash/DASHManager.cpp | 2 ++
2 files changed, 6 insertions(+)
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index cee1254..bdf6e0f 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -239,6 +239,10 @@ static inline locale_t newlocale(int mask, const char * locale, locale_t base)
}
#endif
+#if defined (__cplusplus) && __cplusplus > 199711L
+#define HAVE_STATIC_ASSERT
+#endif
+
#if !defined (HAVE_STATIC_ASSERT)
# define _Static_assert(x, s) ((void) sizeof (struct { unsigned:-!(x); }))
# define static_assert _Static_assert
diff --git a/modules/demux/dash/DASHManager.cpp b/modules/demux/dash/DASHManager.cpp
index b6dca19..50218d7 100644
--- a/modules/demux/dash/DASHManager.cpp
+++ b/modules/demux/dash/DASHManager.cpp
@@ -27,6 +27,8 @@
# include "config.h"
#endif
+#include <cinttypes>
+
#include "DASHManager.h"
#include "mpd/MPDFactory.h"
#include "mpd/SegmentTimeline.h"
--
2.1.3
More information about the vlc-devel
mailing list