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

fix opus.h include #150

Open
Xylemon opened this issue Dec 30, 2022 · 1 comment
Open

fix opus.h include #150

Xylemon opened this issue Dec 30, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@Xylemon
Copy link
Collaborator

Xylemon commented Dec 30, 2022

https://sourceforge.net/p/fteqw/tickets/148/

ferneu1 wrote on 2022-05-30:

Currently (r6257) (and apparently, ever since the first commit), engine/client/snd_dma.c includes opus.h like this

#include "opus.h"

The problem is that opus.h is usually distributed inside a directory named opus, so including it like that breaks the compilation. FTE deals with the problem by adding that opus directory as an additional include directory in the Makefile . It works. Kinda...

Including the header like that will only work on systems that stores opus headers inside /usr/include/opus. The build will break on any systems that store headers somewhere else.

If instead we included the header like this

#include <opus/opus.h>

Not only we could simplify the Makefile by removing the additional header directory it adds for opus, but the build would also work on any system, no matter where the system headers are stored.

I've attached a simple patch that does that.

1 Attachments

00-opus.include.patch

@Xylemon Xylemon added the bug Something isn't working label Dec 30, 2022
@Xylemon
Copy link
Collaborator Author

Xylemon commented Dec 30, 2022

@Shpoike wrote on 2022-07-01:

it SHOULD be using pkg-config instead, like the cmake stuff indirectly does.
(unfortunately I get lazy, and pkg-config isn't always available either, especially when cross-compiling, and frankly we only need the headers anyway so using the host system's version of the headers is generally fine anyway.)

$ pkg-config --cflags opus -I/usr/include/opus

forcing it inside the C code potentially prevents fixing it up with CFLAGS (eg: if the required file is /usr/include/opus-VERSION/opus.h instead).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant