
Hi Simon,
On Mon, Jan 5, 2015 at 10:11 AM, Simon Glass sjg@chromium.org wrote:
Hi Masahiro,
I notice that when compiling I get the full paths to the source when I use __FILE__:
/home/sjg/c/src/third_party/u-boot/files/cros/lib/readwrite.c: vboot_rw_select_kernel: VbSelectAndLoadKernel: 65552 /home/sjg/c/src/third_party/u-boot/files/cros/lib/vboot.c: vboot_set_error: Stage 'VbSelectAndLoadKernel' produced vboot error 0x10010 /home/sjg/c/src/third_party/u-boot/files/cros/vboot/stages.c: vboot_run_stage: Error: stage 'rw_selectkernel' returned -1
Is there a way to only get the relative path, say "cros/lib/readwrite.c"?
I believe you are asking for a preprocessor level solution in gcc? Unforunately AFAIK there is no such support in gcc. We have to do it ourselves with some runtime string operations :-<
Regards, Bin