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

Does not build on OpenBSD #3881

Closed
brad0 opened this issue Mar 5, 2024 · 7 comments
Closed

Does not build on OpenBSD #3881

brad0 opened this issue Mar 5, 2024 · 7 comments

Comments

@brad0
Copy link

brad0 commented Mar 5, 2024

Looking at updating our fmt port from 8.1.1 to 10.2.1 and noticed it no longer builds..

FAILED: test/CMakeFiles/posix-mock-test.dir/posix-mock-test.cc.o
/home/ports/pobj/fmt-10.2.1/bin/c++ -DGTEST_HAS_STD_WSTRING=1 -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1 -I/home/ports/pobj/fmt-10.2.1/fmt-10.2.1/include -isystem /home/ports/pobj/fmt-10.2.1/fmt-10.2.1/test/gtest/. -O2 -pipe -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT test/CMakeFiles/posix-mock-test.dir/posix-mock-test.cc.o -MF test/CMakeFiles/posix-mock-test.dir/posix-mock-test.cc.o.d -o test/CMakeFiles/posix-mock-test.dir/posix-mock-test.cc.o -c /home/ports/pobj/fmt-10.2.1/fmt-10.2.1/test/posix-mock-test.cc
In file included from /home/ports/pobj/fmt-10.2.1/fmt-10.2.1/test/posix-mock-test.cc:21:
/home/ports/pobj/fmt-10.2.1/fmt-10.2.1/test/../src/os.cc:190:23: error: expected unqualified-id
  int fd = FMT_SYSTEM(fileno FMT_DISABLE_MACRO(file_));
                      ^
1 error generated.
@brad0
Copy link
Author

brad0 commented Mar 8, 2024

Reverting 6b0082e and it now builds Ok.

@brad0
Copy link
Author

brad0 commented Mar 15, 2024

Ping.

@vitaut
Copy link
Contributor

vitaut commented Mar 15, 2024

How is fileno defined on your system?

@mwinterb
Copy link
Contributor

The macro used in OpenBSD and FreeBSD is defined like this:

#define fileno(p) (!__isthreaded ? __sfileno(p) : (fileno)(p))

https://gcc.godbolt.org/z/6TEqqn8rT

@vitaut
Copy link
Contributor

vitaut commented Mar 19, 2024

Thanks for the repro, @mwinterb. Tentative fix: 8ecb77f. @brad0, could you confirm that it works?

@brad0
Copy link
Author

brad0 commented Mar 19, 2024

This now builds with the diff applied. Thanks.

@vitaut
Copy link
Contributor

vitaut commented Mar 20, 2024

Thanks for confirming that the fix works. It is merged now.

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

3 participants