[vlc-devel] [PATCH] Fix build on Android

Andrey Gursky andrey.gursky at e-mail.ua
Mon Jan 18 15:48:29 CET 2016


On Mon, 18 Jan 2016 16:28:27 +0200
Rémi Denis-Courmont <remi at remlab.net> wrote:

> Le 2016-01-18 16:22, Andrey Gursky a écrit :
> > On Mon, 18 Jan 2016 11:01:51 +0200
> > Rémi Denis-Courmont <remi at remlab.net> wrote:
> >
> >> Le 2016-01-18 03:57, Andrey Gursky a écrit :
> >> > Hi,
> >> >
> >> > was it not a little bit to optimistic to remove #ifdef IOV_MAX?
> >>
> >> It was there to protect the sendmsg() call, as sendmsg() was missing 
> >> on
> >> Windows. We have a replacement now.
> >
> > Please believe me, I wouldn't complain about it if it wouldn't break 
> > a
> > build on Android.
> 
> Heh, I wrote that ifdef and the code within it. I know why I added that 
> ifdef (because Windows lacked sendmsg()), as I do why I removed it 
> (because we have a replacement for sendmsg(() now).
> 
> IOV_MAX is *not* an optional fancy part of sendmsg(), or more 
> generally, I/O vectors support. IOV_MAX exists to prevent overflows when 
> copying or converting the vectors. VLC can't do without it, and the 
> Linux kernel couldn't do without it either.

Of course I don't doubt you know what you are dealing with. It is not
about this. It is about the Android NDK, which is known to miss many
essential things existing since many years. This define is just
another one example. Thus I propose the following patch.

Regards,
Andrey

--
The commit 9e3be9be6c3ff28c9a0d77b51d9c71fd04b9cee4 starts using of
IOV_MAX unconditionally, which breaks Android build.

IOV_MAX is not defined in the Android NDK (current version r10e).
---
 include/vlc_common.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index 296439e..a000133 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -398,6 +398,12 @@ typedef int ( * vlc_list_callback_t ) ( vlc_object_t *,      /* variable's objec
 #include <AvailabilityMacros.h>
 #endif
 
+#ifdef __ANDROID__
+#   ifndef IOV_MAX
+#       define IOV_MAX 1024
+#   endif
+#endif
+
 #ifdef __OS2__
 #   define OS2EMX_PLAIN_CHAR
 #   define INCL_BASE
-- 
2.6.4


More information about the vlc-devel mailing list