Re: runtime identification of compiler through executable okay sorry .. i was not able to explain my problem
suppose there is a executable
gcc -g -o test test.c
then when i do myproduct test ..
inside that i want to find some way to find out if it was gcc or not
and then set some boolean variable setgcc
and then write something like
if(setgcc)
do this
else
do this
inside my code
i do want to pass any compile time options
Gary R. Hook wrote:
> shankha wrote:
> > i want to use this information in c code .. like if compiler=gcc then
> > do some few things
>
> That's not a runtime assessment, it's a compile time assessment.
> Just require your builder to use -DGCC or -DXLC and
> use #ifdef GCC/etc in your code. |