Discussion:
.make file issues/ configuration parameters in headers
(too old to reply)
JY
2010-04-22 14:28:02 UTC
Permalink
Hi,

I'm trying to #define a parameter like,

#define MY_CONFIG_PARAM 0

in a header file, and then trying to check its value later (in the same
header)

#if $(MY_CONFIG_PARAM) != 0
#define SOMETHING_ELSE
#endif

and I need to do something similar in make files.

In the Visual Studio environment (VS 2005 SP1) it gives me errors when I add
this to the header file. What would be the correct definitions?

TIA,
JY
Igor Tandetnik
2010-04-22 16:54:54 UTC
Permalink
Post by JY
I'm trying to #define a parameter like,
#define MY_CONFIG_PARAM 0
in a header file, and then trying to check its value later (in the
same header)
#if $(MY_CONFIG_PARAM) != 0
#define SOMETHING_ELSE
#endif
#if MY_CONFIG_PARAM != 0
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925
Pavel A.
2010-04-23 15:31:22 UTC
Permalink
In makefile, this woud be

!if $(MY_CONFIG_PARAM) != 0
SOMETHING_ELSE=1
!endif

and # char is a comment.
--pa
Post by Igor Tandetnik
Post by JY
I'm trying to #define a parameter like,
#define MY_CONFIG_PARAM 0
in a header file, and then trying to check its value later (in the
same header)
#if $(MY_CONFIG_PARAM) != 0
#define SOMETHING_ELSE
#endif
#if MY_CONFIG_PARAM != 0
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
Loading...