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

macro INFTIM is not defined in SDL_sndioaudio.c using CMAKE #2511

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

macro INFTIM is not defined in SDL_sndioaudio.c using CMAKE #2511

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 2.1
Reported for operating system, platform: Linux, x86_64

Comments on the original bug report:

On 2017-07-25 04:53:11 +0000, wrote:

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.

On 2017-07-25 06:01:48 +0000, Ryan C. Gordon wrote:

This is probably a bug in the CMake file; sndio is meant for OpenBSD, not Linux.

--ryan.

On 2017-07-25 06:38:26 +0000, Ozkan Sezer wrote:

(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.

On 2017-07-25 23:41:21 +0000, wrote:

I do actually have libsndio-dev installed (not sure why!), so it is definitely possible to have this package on systems other than OpenBSD.

On 2017-08-07 04:27:40 +0000, Ryan C. Gordon wrote:

(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.

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

No branches or pull requests

1 participant