| Summary: | SDL_PIXELFORMAT enum is anonymous, which prevents its use in a templated function | ||
|---|---|---|---|
| Product: | SDL | Reporter: | zen3d <danm> |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 2.0.9 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
|
Description
zen3d
2018-11-11 02:12:24 UTC
Yes, all the enums in the public headers are intended to be typedef'd. If you've already found them, can you provide a patch to fix this? Thanks! I can't say that I have a definitive list of files, since the only one I looked at was SDL_pixels.h, since that was the only one that impacted what I was doing. However, there are several anonymous enums in SDL_pixels.h (but not a lot; maybe 5 or 6). On the other hand, I am not familiar with your coding conventions nor have I set up a build environment for SDL. For the handful of anonymous enums in SDL_pixels.h, it would be just as easy for you to find them and validate correctness of the subsequent build than for me to do it. Sorry. But thanks for considering this issue. Oh, I see what's happening here. The pixel format enum is not intended to be an exhaustive list of pixel formats, so it's an unnamed enumeration of composed values. Your change makes sense, and I'm checking that in. Please let me know if there are other cases where this is a problem. https://hg.libsdl.org/SDL/rev/b590d04d5cf7 Thanks! Thanks, that should address my immediate issue. However, it is not hard to imagine that exercising utilization of other enums by pixie lisp (or elsewhere) might provoke further instances of this issue. But this is a good start. I can probably create more failure instances if that is of interest to you. I reviewed the anonymous unions, and they are that way in general because the values are intended to be used as integer values not limited by a fixed enumerated set. You're welcome to provide real world cases where this causes problems, but please don't contrive cases if they're not affecting anyone. |