On Sat, 2009-05-02 at 07:04 +0200, Michael Bruck wrote:
> I would like to start another holy war while we are at it:
> 
> 
> 1. Are false preprocessor variables in OpenOCD specified by not
> defining a variable or by defining it as 0 ?

OpenOCD's variables are defined as 0 or 1.  This is not standard.

> 2. config.h generated by autotools and cmake use different paradigms for this

Not surprising, but unfortunate.

> 3. several files (including my latest patch for jim.c) use #if(n)def
> HAVE_... which makes no sense with the autotools generated config.h
> 
> see:
> svn diff -r1560:1572 src/helper/jim.c

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.

All of the AC_DEFINE(....[0]) lines could be safely removed, if the code
was simultaneously switched to use #ifdef instead of #if.  Clearly, that
will not be worth the effort unless it would be required by CMake.

> 4. Mildly related: what is _WIN32 ?

A (built-in? header?) symbol provided by CygWin or MinGW32.

Cheers,

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

Reply via email to