#line directive and -D option
Hiroki Kaminaga
kaminaga@sm.sony.co.jp
Wed Dec 17 02:39:00 GMT 2008
Hi,
From: "John (Eljay) Love-Jensen" <eljay@adobe.com>
> Hi Hiroki,
>
> Worked on my machine.
...
> Depending on your shell, you may need to escape the quotes, such as one of these two ways:
> -D MYNAME=\"macrotest\"
> -D MYNAME='"macrotest"'
Ah, above worked, thank you!
By the way, is there any method to strip strings prefix passed to
__FILE__ macro? If .c file is specified by abosolute path, __FILE__
also prints absolute path:
$ cat macro-test.c
#include <stdio.h>
int main(void)
{
printf ("%s: .... \n", __FILE__);
return 0;
}
$ gcc `pwd`/macro-test.c -o macro-test
$ ./macro-test
/home/kaminaga/tmp/dir/macro-test.c: ....
and I was looking for e.g. environment variable that would strip
prefix such as in patch -p option...
Best Regards,
(Hiroki Kaminaga)
t
--
More information about the Gcc-help
mailing list