What is the correct strategy to limit the scope of #define
labels and avoid unwarranted token collision?
In the following configuration:
#define
labels - in only the implementation, ie. c
, filesFurther all #define
could be put separately in yet another file- say: Utility_2_Def.h
(Quite like Microsoft's WinError.h
:Error code definitions for the Win32 api functions)
Overheads:
Gains:
ZERO
is: 0
, '0'
or "Zero"
as to where you use itUtility_2.h
BOOL Utility_2();
Utility_2_Def.h
# define ZERO '0'
# define ONE '1'
Utility_2.c
# include "Utility_2.h"
# include "Utility_2_Def.h"
BOOL Utility_2()
{
...
}