A
Andrew Gabriel
I want to pick up the OS release during compilation in order to
make up for something which is missing from a header file in a
certain release. The Sun C compiler provides a built in predefinition
__`uname -s`_`uname -r`
and as an example, echo __`uname -s`_`uname -r` gives:
__SunOS_5.10
So in my code I have:
#ifdef __SunOS_5.10
/* typedef missing from headerfile */
typedef char *x;
#endif
However, this fails because the "." is treated as the end of the
token, and the excess tokens on the line generate a warning. I've
tried some other varients such as
#ifdef "__SunOS_5.10"
#ifdef __SunOS_5\.10
but these don't work either. Is there a way to do this?
I'm trying to avoid adding any further command line -D's as that's
generated by complex makefiles which I'm not allowed to change.
make up for something which is missing from a header file in a
certain release. The Sun C compiler provides a built in predefinition
__`uname -s`_`uname -r`
and as an example, echo __`uname -s`_`uname -r` gives:
__SunOS_5.10
So in my code I have:
#ifdef __SunOS_5.10
/* typedef missing from headerfile */
typedef char *x;
#endif
However, this fails because the "." is treated as the end of the
token, and the excess tokens on the line generate a warning. I've
tried some other varients such as
#ifdef "__SunOS_5.10"
#ifdef __SunOS_5\.10
but these don't work either. Is there a way to do this?
I'm trying to avoid adding any further command line -D's as that's
generated by complex makefiles which I'm not allowed to change.