On Thu, Aug 11, 2005 at 01:38:20PM +0100, Richard Kettlewell wrote:
Chris Green chris@areti.co.uk writes:
Thanks, yes, I've done similar tricks with #define when wanting a set of enum constants to match a set of string variables. The above certainly does address the globals issue. However it does mean that you have values (other than constants) in the .h file which is (sort of) a bit naughty.
I don't see why...?
.h files are supposed to have no dynamic data in them, otherwise if they're included in different parts of a build you get multiple definitions. Your #define statements making it build in different ways according to where it's called from prevents the multiple definitions but it's rather 'against the philosophy'.