| Summary: | macro INFTIM is not defined in SDL_sndioaudio.c using CMAKE | ||
|---|---|---|---|
| Product: | SDL | Reporter: | kdavison |
| Component: | audio | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | HG 2.1 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
This is probably a bug in the CMake file; sndio is meant for OpenBSD, not Linux. --ryan. (In reply to Ryan C. Gordon from comment #1) > This is probably a bug in the CMake file; sndio is meant for OpenBSD, not > Linux. There is a linux port at sndio.org, so people can actually experiment with sndio on linux if they want to. As for INFTIM macro: from the poll() man page: http://man7.org/linux/man-pages/man2/poll.2.html --- Some implementations define the nonstandard constant INFTIM with the value -1 for use as a timeout for poll(). This constant is provided in glibc. --- ... so the ifdef suggestion of the OP seems plausible IMO. I do actually have libsndio-dev installed (not sure why!), so it is definitely possible to have this package on systems other than OpenBSD. (In reply to kdavison from comment #3) > I do actually have libsndio-dev installed (not sure why!), so it is > definitely possible to have this package on systems other than OpenBSD. Huh, I'm surprised by this. :) Anyhow, this should be fixed in https://hg.libsdl.org/SDL/rev/c4ff854c6586, and we'll add that package to the Linux buildbots so it'll get code coverage in the future! --ryan. |
Overview: INFTIM macro was not defined on my local system causing compilation to fail. Steps 1. don't have INFTIM macro defined (maybe I'm missing a driver?) 2. clone SDL from mercurial or one of the many github mirrors 3. build using CMAKE and add_subdirectory Expected Result: built SDL2 libraries Actual Result: compilation failure due to undefined INFTIM macro. Additional Information: SDL Version 2.0.5.1.5 on Ubuntu 16.04 using CMAKE Proposed Fix: Through googling and inspection I determined that INFTIM should be set to (-1). Option #1: define macro (probably the safest) #ifndef INFTIM #define INFTIM (-1) #endif //#ifndef INFTIM static int SNDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) { Option #2: remove use of the macro poll(this->hidden->pfd, nfds, INFTIM) to poll(this->hidden->pfd, nfds, -1) but this assumes that all poll(...) implementations recognize -1 as infinite timeout.