Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android build fixes #709

Closed
wants to merge 17 commits into from
Closed

Android build fixes #709

wants to merge 17 commits into from

Conversation

BenEfrati
Copy link
Contributor

I encountered some compilation error when trying to build tvheadend for android
I hope it resolves all errors.

Resolve:
src/tvhpoll.c: In function 'tvhpoll_create':
src/tvhpoll.c:73:3: error: implicit declaration of function 'epoll_create1' [-Werror=implicit-function-declaration]
   if ((fd = epoll_create1(EPOLL_CLOEXEC)) < 0) {
   ^
src/tvhpoll.c:73:27: error: 'EPOLL_CLOEXEC' undeclared (first use in this function)
   if ((fd = epoll_create1(EPOLL_CLOEXEC)) < 0) {
                           ^
Resolve:
src/fsmonitor.c: In function 'fsmonitor_init':
src/fsmonitor.c:108:3: error: implicit declaration of function 'inotify_init1' [-Werror=implicit-function-declaration]
   fsmonitor_fd = inotify_init1(IN_CLOEXEC);
   ^
src/fsmonitor.c:108:32: error: 'IN_CLOEXEC' undeclared (first use in this function)
   fsmonitor_fd = inotify_init1(IN_CLOEXEC);
                                ^
src/dvr/dvr_rec.c:32:25: fatal error: sys/statvfs.h: No such file or directory
 #include <sys/statvfs.h>
                         ^
src/satip/rtp.c: In function 'satip_rtcp_thread':
src/satip/rtp.c:608:7: error: implicit declaration of function 'sendto' [-Werror=implicit-function-declaration]
       r = sendto(rtp->fd_rtcp, msg, len, 0,
       ^
src/input/mpegts/iptv/iptv_rtsp.c: In function 'iptv_rtsp_read':
src/input/mpegts/iptv/iptv_rtsp.c:264:5: error: implicit declaration of function 'recv' [-Werror=implicit-function-declaration]
     r = recv(im->mm_iptv_fd2, buf, sizeof(buf), MSG_DONTWAIT);
     ^
src/timeshift/timeshift_reader.c: In function '_timeshift_read':
src/timeshift/timeshift_reader.c:353:5: error: format '%jd' expects argument of type 'intmax_t', but argument 8 has type 'off_t' [-Werror=format=]
     tvhtrace("timeshift", "ts %d seek to %jd (fd %i)", ts->id, tsf->roff, tsf->rfd);
     ^
src/timeshift/timeshift_reader.c:369:5: error: format '%ld' expects argument of type 'long int', but argument 9 has type 'ssize_t' [-Werror=format=]
     tvhtrace("timeshift", "ts %d read msg %p (%ld)", ts->id, *sm, r);  // Android bug, ssize_t is long int
     ^
src/timeshift/timeshift_reader.c:377:9: error: format '%jd' expects argument of type 'intmax_t', but argument 8 has type 'off_t' [-Werror=format=]
         tvhtrace("timeshift", "ts %d seek to %jd (fd %i) (incomplete)", ts->id, tsf->roff, tsf->rfd);
         ^
src/dvr/dvr_inotify.c: In function 'dvr_inotify_init':
src/dvr/dvr_inotify.c:66:3: error: implicit declaration of function 'inotify_init1' [-Werror=implicit-function-declaration]
   _inot_fd = inotify_init1(IN_CLOEXEC);
   ^
src/dvr/dvr_inotify.c:66:28: error: 'IN_CLOEXEC' undeclared (first use in this function)
   _inot_fd = inotify_init1(IN_CLOEXEC);
                            ^
src/descrambler/capmt.c: In function 'capmt_write_msg':
src/descrambler/capmt.c:620:5: error: format '%li' expects argument of type 'long int', but argument 9 has type 'ssize_t' [-Werror=format=]
     tvhlog(LOG_DEBUG, "capmt", "%s: Message send failed to socket %i (%li)", capmt_name(capmt), fd, res); // Android bug, ssize_t is long int
     ^
@@ -63,7 +63,11 @@ pthread_t dvr_inotify_tid;

void dvr_inotify_init ( void )
{
#if ENABLE_ANDROID
_inot_fd = inotify_init();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, define inotify_init1 in tvheadend.h - there's already android block - like:

#define inotify_init1(a) inotify_init()

add casting to support compilation with android ndk.
src/timeshift/timeshift_reader.c: In function '_timeshift_read':
src/timeshift/timeshift_reader.c:353:5: error: format '%jd' expects argument of type 'intmax_t', but argument 8 has type 'off_t' [-Werror=format=]
     tvhtrace("timeshift", "ts %d seek to %jd (fd %i)", ts->id, tsf->roff, tsf->rfd);
     ^
src/timeshift/timeshift_reader.c:369:5: error: format '%ld' expects argument of type 'long int', but argument 9 has type 'ssize_t' [-Werror=format=]
     tvhtrace("timeshift", "ts %d read msg %p (%ld)", ts->id, *sm, r);  // Android bug, ssize_t is long int
     ^
src/timeshift/timeshift_reader.c:377:9: error: format '%jd' expects argument of type 'intmax_t', but argument 8 has type 'off_t' [-Werror=format=]
         tvhtrace("timeshift", "ts %d seek to %jd (fd %i) (incomplete)", ts->id, tsf->roff, tsf->rfd);
         ^
@perexg
Copy link
Contributor

perexg commented Sep 14, 2015

Thanks merged in one patch: 857a7fb

@perexg perexg closed this Sep 14, 2015
@BenEfrati BenEfrati deleted the android-build-patch branch November 1, 2015 19:21
@BenEfrati BenEfrati restored the android-build-patch branch November 1, 2015 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants