C
Charles Sullivan
I'm trying to maintain some older C code (FOSS) which has been
patched by various individuals over the years for portability to
multiple Unix-like operating systems, to wit: Linux, SunOS,
Solaris, Free/Open/NetBSD, Mac OS X, AT&T SysV r4, SCO Unix, AIX,
OSF, NextStep.
I want to add some conditionals like this:
#if defined(USECODE_A)
/*use this code */
#elif defined(USECODE_B)
/*use this code */
#elif defined(USECODE_C)
/*use this code */
#elif defined(USECODE_D)
/*use this code */
#else
/*use this code*/
#endif
However although in the existing code there are numerous
"#if/#else/#endif" conditionals with what seems like awkward
nesting, nowhere do I find "#elif" used.
K&R 2nd edition (1988) says #elif is new since the 1978 edition.
How likely is there to be a portability problem if I use #elif ?
Thanks for your advice.
Regards,
Charles Sullivan
patched by various individuals over the years for portability to
multiple Unix-like operating systems, to wit: Linux, SunOS,
Solaris, Free/Open/NetBSD, Mac OS X, AT&T SysV r4, SCO Unix, AIX,
OSF, NextStep.
I want to add some conditionals like this:
#if defined(USECODE_A)
/*use this code */
#elif defined(USECODE_B)
/*use this code */
#elif defined(USECODE_C)
/*use this code */
#elif defined(USECODE_D)
/*use this code */
#else
/*use this code*/
#endif
However although in the existing code there are numerous
"#if/#else/#endif" conditionals with what seems like awkward
nesting, nowhere do I find "#elif" used.
K&R 2nd edition (1988) says #elif is new since the 1978 edition.
How likely is there to be a portability problem if I use #elif ?
Thanks for your advice.
Regards,
Charles Sullivan