Re: macro to print filename

Zhongye Jia <[email protected]> Thu, 2 Jun 2011 02:45:06 +0800
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <[email protected]>
I do not think this can be done in *compiling* time, neither macro in
c nor template in c++, so would you be so kind to offer the solution
by using template or just give  some tips? Since I'm not that good at
c++ :)

On Thu, Jun 2, 2011 at 01:38, Michal Nazarewicz <[email protected]> wrote:
> On Wed, 01 Jun 2011 18:07:42 +0200, ratheesh kannoth
> <[email protected]> wrote:
>>
>> __FILE__ macro prints relative path name of the file.
>
> Not prints but expands to but we know what you mean. ;)
>
>> I need only filename. How to extract this?
>>
>> I don't want to use any string library - since it includes more
>> Processing and needs to store the character array in executable.
>> Is there any method at preprocessing level to do this.
>
> I can say with 99,9% confidence that there is no such thing in C
> standard and 99% that there is no such thing in GCC.
>
> You probably can do that in C++ with templates if that's any
> constellation.
>
> --
> Best regards,                                         _     _
> .o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
> ..o | Computer Science,  Michal "mina86" Nazarewicz    (o o)
> ooo +-----<email/xmpp: [email protected]>-----ooO--(_)--Ooo--
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-c-programming" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html