[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: can autoconf determine if a preprocessor macro is defined or not?
From: |
Keith MARSHALL |
Subject: |
Re: can autoconf determine if a preprocessor macro is defined or not? |
Date: |
Mon, 31 Jul 2006 11:22:31 +0100 |
Ed Hartnett wrote, quoting me:
>> However, IMO that's a lazy hack -- it suggests that you aren't
>> really thinking about *why* you specified those attributes in the
>> first place, and what the implications are, when you port your code
>> to a different OS. But, it's your code -- abuse it as you wish.
>
> I know exactly what is happening, and using zeros will work just fine.
You may well know what's happening, and that's fine; but will another
programmer, especially one who specialises in Woe32 programming, be
able to read your code, without wondering "What's all this rubbish;
it doesn't make any sense on Windows?"
Isn't it cleaner to abstract the platform dependent stuff out of the
mainstream of the C/C++ code, into a `platform.h' file say, where you
define your own manifest constants, to represent appropriate grouping
of the standard definitions in a platform dependent manner, and then
use those specialised definitions in the mainstream code?
Just my 2p. As I said, it's your code.
Regards,
Keith.