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
cc.has_header_symbol() does not work for struct definitions #1975
Comments
|
No fix yet ? I've been using it for ages without knowing it was broken. |
|
https://cmake.org/cmake/help/v3.0/module/CheckSymbolExists.html
CMake checks symbols ( = function, macro, variable) apart from types. Maybe Meson should do the same as it seems buggy to merge the two. |
|
If I understand correctly, you can use cc.has_type() to test for the presence of "struct foo", eg Question: is there any valid use for passing a string with spaces in it to cc.has_header_symbol()? If not, would it be worth making that a syntax error or at least a warning, to catch accidental attempts to use it on "struct something" ? (The generated code for has_header_symbol() clearly doesn't envisage being passed multiple words, because it will generate "#ifndef struct foo", which is bogus syntax and provokes compiler warnings during compilation of the test case.) (Commenting because we just fell over this with QEMU's meson.build.) |
Yes, this issue is obsolete now. I'll close it.
Absolutely, yes. Could you open a PR that does that and CC me on it? |
|
I'm not sufficiently familiar with meson's internals to submit a pullreq, I'm afraid. |
|
That's okay, we can offer advice. :) You can find the compiler implementations in mesonbuild/compilers/, the base (stub) implementation which raises NotImplementedError is in compilers.py and overridden implementations for each language include for this function, c.py and cpp.py and cuda.py Check for |
This is because our check evaluates to:
Which is just a prototype definition.
The text was updated successfully, but these errors were encountered: