-
Notifications
You must be signed in to change notification settings - Fork 456
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
opj_includes.h shouldn't define __attribute__
#727
Comments
At least Debian's clang also defines |
Well, clang defines For this case, not defining something starting with __ is best, as that's not allowed per standard :-) (I work on clang.) |
FWIW, I just removed these 4 lines in the version of openjpeg used in pdfium (the library Chromium uses to render pdf files), and at least on the platforms we build on everything kept working. So maybe just deleting these 4 lines is an option. (https://codereview.chromium.org/1810373002/diff/20001/third_party/libopenjpeg20/opj_includes.h) |
Thanks! :-) |
opj_includes.h has this snippet:
That's not valid, things starting with two underscores are reserved for the implementation and shouldn't be redefined. In practice, it's even actively harmful: When building openjpeg with clang-cl,
__GNUC__
isn't defined, so__attribute__
gets defined to nothing, and then the same file includes <intrin.h> a bit futher down. clang-cl's intrin.h header uses__attribute__
internally, and since it's included after this redefine, clang-cl gets very confused.One approach would be to do
And then use ATTRIB everywhere -- but from what I can tell, all uses of
__attribute__
are already guarded by other diffs and just deleting these 4 lines should probably be fine too.(This blocks https://crbug.com/592745)
The text was updated successfully, but these errors were encountered: