I have two header files in which I include that both have the same typedef.
Say aaa.h and bbb.h. They came from 2 unrelated third-party packages, and I do not control these 2 files, but they have to use them. I do not include both files directly, but they are more likely included in the top-level header file. (i.e., I include ah and bh, which included them accordingly)
My program will not compile when they are both included due to a name conflict.
So, with my workaround, I copied aaa.h into my source tree with only a remote typedef called myaaa.h. At the top of the file, I keep the shell "#ifndef AAA_H, #define AAA_H" unchanged, so when I turn on myaaa.h, aaa.h will not turn on because the AAA_H flag is already defined, the typedef conflict is indirectly removed.
Is there a more convenient way to do this without adding such a file (and I have to control it) in my source code?
Thanks!
source share