I know that #define
s, etc. are normally never indented. Why?
I'm working in some code at the moment which has a horrible mixture of #define
s, #ifdef
s, #else
s, #endif
s, etc. All these often mixed in with normal C code. The non-indenting of the #define
s makes them hard to read. And the mixture of indented code with non-indented #define
s is a nightmare.
What is the benefit of not indenting #define
s? Does it make me a bad person if I indent them? Isn't this much nicer?
#ifdef SDCC
#if DEBUGGING == 1
#if defined (pic18f2480)
#define FLASH_MEMORY_END 0x3DC0
#elif defined (pic18f2580)
#define FLASH_MEMORY_END 0x7DC0
#else
#error "Can't set up flash memory end!"
#endif
#else
#if defined (pic18f2480)
#define FLASH_MEMORY_END 0x4000
#elif defined (pic18f2580)
#define FLASH_MEMORY_END 0x8000
#else
#error "Can't set up flash memory end!"
#endif
#endif
#else
#if DEBUGGING == 1
#define FLASH_MEMORY_END 0x7DC0
#else
#define FLASH_MEMORY_END 0x8000
#endif
#endif
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…