Hi,
It's not clear if A16-0-1 allows using #define exclusively for creating header guards, or also for conditional file inclusion. Could you comment on that?
Example:
Thanks!
It's not clear if A16-0-1 allows using #define exclusively for creating header guards, or also for conditional file inclusion. Could you comment on that?
Example:
Code:
// foo.h
#if defined (SOMETHING) && !defined (SOMETHING_ELSE) // Complex logic that we don't want to repeat everywhere
#define SHOULD_INCLUDE_A // Violating A16-0-1?
#else
#define SHOULD_INCLUDE_B // Violating A16-0-1?
#endif
// bar.h
#if defined (SHOULD_INCLUDE_A)
#include "bar_a.h"
#elif defined (SHOULD_INCLUDE_B)
#include "bar_b.h"
#endif
// baz.h
#if defined (SHOULD_INCLUDE_A)
#include "baz_a.h"
#elif defined (SHOULD_INCLUDE_B)
#include "baz_b.h"
#endif
Thanks!