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

CMake: Fix build with OpenBSD #711 #713

Merged
merged 1 commit into from Jun 11, 2023

Conversation

brad0
Copy link
Contributor

@brad0 brad0 commented Jun 11, 2023

Setting _POSIX_C_SOURCE on OpenBSD breaks the build. _BSD_SOURCE needs to be set at the same time to enable some functions.

In file included from /home/brad/tmp/ffmpeg-ports/ports/pobj/minizip-4.0.0/minizip-ng-4.0.0/test/test_main.cc:5:
In file included from /usr/local/include/gtest/gtest.h:55:
In file included from /usr/include/c++/v1/ostream:140:
In file included from /usr/include/c++/v1/locale:218:
/usr/include/c++/v1/__bsd_locale_fallbacks.h:122:17: error: use of undeclared identifier 'vasprintf'; did you mean 'vsprintf'?
    int __res = vasprintf(__s, __format, __va);
                ^
/usr/include/c++/v1/cstdio:124:9: note: 'vsprintf' declared here
using ::vsprintf _LIBCPP_USING_IF_EXISTS;
        ^
In file included from /home/brad/tmp/ffmpeg-ports/ports/pobj/minizip-4.0.0/minizip-ng-4.0.0/test/test_main.cc:5:
In file included from /usr/local/include/gtest/gtest.h:55:
In file included from /usr/include/c++/v1/ostream:140:
In file included from /usr/include/c++/v1/locale:218:
/usr/include/c++/v1/__bsd_locale_fallbacks.h:122:27: error: cannot initialize a parameter of type 'char *' with an lvalue of type 'char **'
    int __res = vasprintf(__s, __format, __va);
                          ^~~
/usr/include/stdio.h:269:21: note: passing argument to parameter here
int      vsprintf(char *, const char *, __va_list);
                        ^
2 errors generated.

Setting _POSIX_C_SOURCE on OpenBSD breaks the build. _BSD_SOURCE needs
to be set at the same time to enable some functions.

In file included from /home/brad/tmp/ffmpeg-ports/ports/pobj/minizip-4.0.0/minizip-ng-4.0.0/test/test_main.cc:5:
In file included from /usr/local/include/gtest/gtest.h:55:
In file included from /usr/include/c++/v1/ostream:140:
In file included from /usr/include/c++/v1/locale:218:
/usr/include/c++/v1/__bsd_locale_fallbacks.h:122:17: error: use of undeclared identifier 'vasprintf'; did you mean 'vsprintf'?
    int __res = vasprintf(__s, __format, __va);
                ^
/usr/include/c++/v1/cstdio:124:9: note: 'vsprintf' declared here
using ::vsprintf _LIBCPP_USING_IF_EXISTS;
        ^
In file included from /home/brad/tmp/ffmpeg-ports/ports/pobj/minizip-4.0.0/minizip-ng-4.0.0/test/test_main.cc:5:
In file included from /usr/local/include/gtest/gtest.h:55:
In file included from /usr/include/c++/v1/ostream:140:
In file included from /usr/include/c++/v1/locale:218:
/usr/include/c++/v1/__bsd_locale_fallbacks.h:122:27: error: cannot initialize a parameter of type 'char *' with an lvalue of type 'char **'
    int __res = vasprintf(__s, __format, __va);
                          ^~~
/usr/include/stdio.h:269:21: note: passing argument to parameter here
int      vsprintf(char *, const char *, __va_list);
                        ^
2 errors generated.
@nmoinvaz nmoinvaz merged commit 57be074 into zlib-ng:develop Jun 11, 2023
25 checks passed
@nmoinvaz
Copy link
Member

Thanks!

@brad0 brad0 deleted the cmake_openbsd_fix branch December 16, 2023 00:43
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