Fix compilation error if PACKED is defined before including FMT#3633
Fix compilation error if PACKED is defined before including FMT#3633glebm wants to merge 1 commit into
PACKED is defined before including FMT#3633Conversation
Reduces the chance of conflicts between a macro declaration and the template argument name by using CamelCase (`PACKED` -> `IsPacked`) Fixes fmtlib#3632
|
Thanks for the PR but this should be fixed in libctru by prefixing the macro. We shouldn't be trying to avoid conflicts with poorly named macros from random third-party libraries. In the meantime you can undefine the problematic macro yourself after including the headers that define it. |
|
Philosophically correct but why name a template parameter in all caps? This style is usually used for C macros and enums and doesn't seem consistent with the rest of libfmt anyway |
|
Non-type template parameters normally follow this style. |
|
For what it's worth, my company also defines a Would you be open to changing this parameter name to You're right that it isn't this library's responsibility to ensure that your names don't conflict with other people's macros, but |
|
I would like to second that, ‘PACKED’ is also a bit too common and it’s causing headaches trying to upgrade fmt. Would you reconsider @vitaut ? If not we’ll find a solution but it seems like a small lift if this PR is all it takes. |
|
We don't try to workaround conflicts with poorly written macros unless they are part of system APIs but this particular one is no longer there for other reasons. |
Reduces the chance of conflicts between a macro declaration and the template argument name by using CamelCase (
PACKED->IsPacked)This improves compatibility with oddball SDKs, such as the 3DS libctru.
Fixes #3632