On Sat, 2009-05-02 at 12:26 +0200, Michael Schwingen wrote:
> Zach Welch wrote:
> > With autotools, #ifdef should be preferred.   For example, HAVE_FOO_H
> > will be defined 1 by the AC_CHECK_HEADERS([foo.h],[1],[Comment]) macro;
> > configure defines the symbol to the given value if foo.h is present, and
> > the symbol is not defined if absent.  In both cases, the definition will
> > exist in config.h, but it will be commented out when not defined; the
> > same would be true for the OpenOCD symbols, except that they are defined
> > explicitly.
> >   
> I don't know about autotools, but I do prefer #if, because that way, you
> get warnings if the correct headers are not included. When using #ifdef,
> a missing header may lead to wrong code without a warning.

If the header is required, the configure step should fail when it is not
found in the system.  The rule is to fail as early as possible.

Which headers?

Cheers,

Zach
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to