I had an enum TokenType
defined in one of the header files in my project.
When I later included <windows.h>
to some header, the compiler complained it already defines its own TokenType
.
What is the convention in C to avoid such naming collisions? Must I name any public thing used throughout my project (function, enum, typedef struct, etc.) with a MyProject_
prefix? For example MyProject_TokenType
? It seems ugly. What is the common approach to this?
What would be the common approach for libraries, and what would be the approach for standalone applications (such as my own)?