[vlc-devel] [PATCH] include/vlc_fixups.h: uClibc needs __STDC_FORMAT_MACROS

Bernd Kuhls bernd.kuhls at t-online.de
Sat Apr 2 18:18:49 CEST 2016


Fixes compile error with gcc-4.9.3:

  CXX      demux/mkv/libmkv_plugin_la-util.lo
In file included from ../include/vlc_common.h:893:0,
                 from demux/mkv/mkv.hpp:38,
                 from demux/mkv/util.cpp:24:
demux/mkv/util.cpp: In function 'void handle_real_audio(demux_t*, mkv_track_t*, block_t*, mtime_t)':
demux/mkv/util.cpp:192:79: error: expected ')' before 'PRId64'
             msg_Dbg( p_demux, "discard non-key preroll block in track %d at%" PRId64,
                                                                               ^

Signed-off-by: Bernd Kuhls <bernd.kuhls at t-online.de>
---
 configure.ac         | 2 +-
 include/vlc_fixups.h | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5b493f8..dfcc075 100644
--- a/configure.ac
+++ b/configure.ac
@@ -793,7 +793,7 @@ dnl  BSD
 AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
 
 dnl  GNU/Linux
-AC_CHECK_HEADERS([getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
+AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
 
 dnl  MacOS
 AC_CHECK_HEADERS([xlocale.h])
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 95542a1..39581ff 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -26,9 +26,14 @@
 #ifndef LIBVLC_FIXUPS_H
 # define LIBVLC_FIXUPS_H 1
 
+/* needed to detect uClibc */
+#ifdef HAVE_FEATURES_H
+#include <features.h>
+#endif
+
 /* C++11 says there's no need to define __STDC_*_MACROS when including
  * inttypes.h and stdint.h. */
-#if defined (__cplusplus) && (!defined(HAVE_CXX11) || defined(__MINGW32__))
+#if defined (__cplusplus) && (!defined(HAVE_CXX11) || defined(__MINGW32__) || defined(__UCLIBC__))
 # ifndef __STDC_FORMAT_MACROS
 #  define __STDC_FORMAT_MACROS 1
 # endif
-- 
2.8.0.rc3



More information about the vlc-devel mailing list