Libraries that use these SHORT typedef without a prefix are poorly designed since there are no namespaces in C, so they severely restrict users. Good, but we have to live with it.
If typedefs defined the same type, there would be no problem as you can repeat:
typedef int SHORT; typedef int SHORT;
as many times as you want if it defines the same base type. But there are different types, so the problem.
One hack will use the word-only replacement throughout the FatFs library, including / sources, to replace SHORT with FF_SHORT .
Now you can enable both libraries without any conflicts.
- main advantage: no need for additional changes or wrappers (for example, offers the best answer): fast and dirty.
- main disadvantage: it must be executed every time the library interface is updated.
source share