On Fri, 2006 Jul 28 11:25:48 +0200, Bernd Petrovitsch wrote: > On Thu, 2006-07-13 at 23:58 -0400, Daniel Richard G. wrote: > > > > * Don't use "#if WITH_FOO", as this produces a warning if WITH_FOO is > > undefined. Use "#ifdef". > > Personally I would define them to always have a value (be it "0" or "1" > for "false" and "true") - and set them correctly in a .h file or > Makefile - so you catch typos using them.
There are tradeoffs with the two approaches. I believe autoconf settled on #define/#undef/#ifdef to allow easy re-use of source files in different environments/contexts, as you don't have to #define all the macros that a source file uses to get a clean build. (The ubiquitous "#ifdef HAVE_CONFIG_H" clause also serves the same end.) --Daniel -- NAME = Daniel Richard G. ## Remember, skunks _\|/_ meef? EMAIL1 = [EMAIL PROTECTED] ## don't smell bad--- (/o|o\) / EMAIL2 = [EMAIL PROTECTED] ## it's the people who < (^),> WWW = http://www.******.org/ ## annoy them that do! / \ -- (****** = site not yet online) _______________________________________________ autofs mailing list [email protected] http://linux.kernel.org/mailman/listinfo/autofs
