On Jul 8, 2013, at 09:43 , Vipul Nayyar <[email protected]> wrote:

> /* Define this to use interrupt driver UART driver */
> #define USE_INTERRUPTS 1

( . . . )

> #if defined(USE_INTERRUPTS)

Personal observation:

I don't like using "#define USE_INTERRUPTS 1" in conjunction with "#if 
defined(USE_INTERRUPTS)".  Someone not too careful will change it to "#define 
USE_INTERRUPTS 0" and not understand why it is still being used.

I either use "#define USE_INTERRUPTS" (I know it is defined to be 1) or 
"#define USE_INTERRUPTS 1" (or 0) in conjunction with "#if USE_INTERRUPTS".  I 
use the second idiom in my own code, it also protects against typos such as 
"#if defined(USE_INTERUPTS)"

Peter
-----------------
Peter Dufault
HD Associates, Inc.      Software and System Engineering


_______________________________________________
rtems-devel mailing list
[email protected]
http://www.rtems.org/mailman/listinfo/rtems-devel

Reply via email to