In C language programming, for a relatively large project, the use of the library will be more, if the design of a slight negligence, it may create a macro-defined conflict. An example of a project is that the two header file defines "isspace (CH)", and the two macro definitions are inconsistent, causing the entire project to fail to compile.
The solution to this problem is to undefine the macro by undefine the conflicting macros immediately after the include statement. For example, the library liba.h and header file app_pub.h have different definitions of isspace (CH), and if you use these two files, you will create a macro-defined conflict, and you can have one undefine (a prerequisite is that a macro that is not a two-header file definition will be used): # Include "App_pub.h"
#ifdef isspace
#undef isspace
#endif
This approach is a frustrating way to resolve a macro-definition conflict. In fact, the scope of the macro definition has long been criticized, especially in the header file, was included several times, inadvertently covered, and then reused, perhaps at this time is not the original meaning, and we do not know when used.
For this reason, there is a simple principle to reduce the conflict of macro definitions, that is, try not to place the macro definition in the header file unless you have a reason not to put it in the header file. In addition, there is a strategy that if a file/library function is not used elsewhere, then do not put it in the header file. The header file should be an interface, not a hodgepodge of malatang.