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.
Why are #define
s typically not indented? Is there a reason one wouldn't indent (e.g. like this code below)?
#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