Re: can autoconf determine if a preprocessor macro is defined or not?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux