Here, libctru defines some macros that can clash with other things:
|
/// Packs a struct (and other types?) so it won't include padding bytes. |
|
#define PACKED __attribute__((packed)) |
For example, with the latest version of libfmt, this does not work:
#include <3ds.h>
#include <fmt/core.h>
This is because libfmt uses PACKED as a template parameter name in one of its functions:
https://github.com/fmtlib/fmt/blob/d4987546a4269cc21565ea633eed56db09039d1a/include/fmt/core.h#L1557-L1558
Including things in the opposite order works but really 3ds should not define such macros publicly:
#include <fmt/core.h>
#include <3ds.h>
This can be tricky to work around in a medium size codebase, e.g. diasurgical/DevilutionX#6585
Here, libctru defines some macros that can clash with other things:
libctru/libctru/include/3ds/types.h
Lines 51 to 52 in a4634c0
For example, with the latest version of libfmt, this does not work:
This is because libfmt uses
PACKEDas a template parameter name in one of its functions:https://github.com/fmtlib/fmt/blob/d4987546a4269cc21565ea633eed56db09039d1a/include/fmt/core.h#L1557-L1558
Including things in the opposite order works but really 3ds should not define such macros publicly:
This can be tricky to work around in a medium size codebase, e.g. diasurgical/DevilutionX#6585