Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bonnie.concordia.ca!ccu.umanitoba.ca!umsmigie From: umsmigie@ccu.umanitoba.ca (Jason Smigiel) Newsgroups: comp.lang.c Subject: structured entry of #if preprocessor commands Message-ID: <1991Feb10.063915.5476@ccu.umanitoba.ca> Date: 10 Feb 91 06:39:15 GMT Distribution: na Organization: University of Manitoba, Winnipeg, Canada Lines: 46 Is it common practice not to structure preprocessor commands in ANSI C? I've been staring at code that reads like this: #if defined(MSDOS) #if defined(ANSI) #include "ms_ansi.h" #endif #else /* not msdos */ #if !defined(ATARIST_MWC) && !defined(MAC) && !defined(AMIGA) #ifndef VMS #include #endif #include #endif #endif While it makes a lot more sense to me to write it something like this: #if defined(MSDOS) #if defined(ANSI) #include "ms_ansi.h" #endif #else /* not msdos */ #if !defined(ATARIST_MWC) && !defined(MAC) && !defined(AMIGA) #ifndef VMS #include #endif #include #endif #endif I looked in the K&R2 reference manual, under A12,(very first paragraph) and it states: "Lines beginning with #, perhaps preceeded by white space, communicate with this preprocessor." So it seems completely valid to me, I just wanted to know if this was a smart thing to do or am I entirely insane? Jason Smigiel umsmigie@ccu.umanitoba.ca