This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Use command line defines vs defining in header files.
- To: gcc at gcc dot gnu dot org
- Subject: Re: Use command line defines vs defining in header files.
- From: rlau at csc dot com
- Date: Mon, 28 Aug 2000 17:04:53 -0500
Now, let get back to the my question.
Anyone please.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Can anyone give me a strong argument as whether defining constants for
conditional compiling as compiler argument vs.
defining thems in header files?
for examples:
test.h
#ifdef COMPILER_OPT1
:
#else
:
#endif
#ifdef COMPILER_OPT2
:
#else
:
#endif
-------------------------------------------
So, if I would be defining COMPILER_OPT1 as compiler argument, I would do
something like gcc -d COMPILER_OPT1 test.cpp.
If I would defining COMPILER_OPT1 in header files, I would define it in
test.h before #ifdef COMPILER_OPT1.