LCDproc development and user support list

Text archives Help

[Lcdproc] Patch: Refactoring min/max macros

Chronological Thread 
  • From: bsdfan at (Markus Dolze)
  • Subject: [Lcdproc] Patch: Refactoring min/max macros
  • Date: Thu, 12 Nov 2009 19:39:38 +0100

Ethan Dicks wrote:
> On 11/1/09, Markus Dolze <bsdfan at> wrote:
>> I introduced a new file shared/defines.h into which I moved those macros
>> and
>> removed them from all other places. I thought of using config.h for this,
>> but it is not #ifdef protected.
> .
> .
> .
>> Comments?
> I have yet to see much variation from machine to machine for min() and
> max() definitions though I grant there could be some. Would it be
> reasonable to put definitions of min() and max() in config.h inside
> #ifndef's? Is that likely to trip up any of the required definitions
> for compilers for supported environments?

I put those the macro definitions in defines.h and used #ifndef, similar
to what clients/lcdproc/main.[ch] did.

I thought of using config.h for this, but config.h itself is not #ifdef
protected so it cannot be included several times (some files use min/max
in LCDd and their header files reference each other).

This way we may also move some of our own commonly used macros like
chain(), TRUE and FALSE into defines.h.


Archive powered by MHonArc 2.6.18.

Top of page