BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Name of current function

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Command Line Tools)
View previous topic :: View next topic  
Author Message
Christopher Benson-Manica
Guest





PostPosted: Mon May 16, 2005 2:17 pm    Post subject: Name of current function Reply with quote



C99 defines the manifest constant __func__, which expands to the name
of the current function. The C++ Builder 4 documentation pretty
clearly indicates that neither __func__ nor the GNU version
__FUNCTION__ are supported. Is this manifest constant or an
equivalent present in later versions of C++ Builder?

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Back to top
Ed Mulroy [TeamB]
Guest





PostPosted: Mon May 16, 2005 4:40 pm    Post subject: Re: Name of current function Reply with quote



C++ Builder provides __FILE__ and __LINE__ With them you not only
know the function, you know on which line within the function.

.. Ed

Quote:
Christopher Benson-Manica wrote in message
news:4288ab71 (AT) newsgroups (DOT) borland.com...

C99 defines the manifest constant __func__, which expands to
the name of the current function. The C++ Builder 4
documentation pretty clearly indicates that neither __func__
nor the GNU version __FUNCTION__ are supported. Is this
manifest constant or an equivalent present in later versions of
C++ Builder?



Back to top
Christopher Benson-Manica
Guest





PostPosted: Mon May 16, 2005 5:39 pm    Post subject: Re: Name of current function Reply with quote



Ed Mulroy [TeamB] <dont_email_me (AT) invalid (DOT) com> wrote:

Quote:
C++ Builder provides __FILE__ and __LINE__ With them you not only
know the function, you know on which line within the function.

Yes, I know about those; they're fine for debugging, but for display
purposes the aforementioned __FUNC__ macros would be most desirable.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.

Back to top
Andrue Cope [TeamB]
Guest





PostPosted: Tue May 17, 2005 7:51 am    Post subject: Re: Name of current function Reply with quote

Christopher Benson-Manica wrote:

Quote:
Yes, I know about those; they're fine for debugging, but for display
purposes the aforementioned FUNC macros would be most desirable.

You have it. It's called __FUNC__. We use it in our error handler.

--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html

Back to top
Christopher Benson-Manica
Guest





PostPosted: Tue May 17, 2005 12:37 pm    Post subject: Re: Name of current function Reply with quote

Andrue Cope [TeamB] <no.spam (AT) not (DOT) a.valid.address> wrote:

Quote:
You have it. It's called __FUNC__. We use it in our error handler.

I've been told that it was introduced with C++ Builder 5;
unfortunately we are still using version 4.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.

Back to top
Alisdair Meredith [TeamB]
Guest





PostPosted: Tue May 17, 2005 3:23 pm    Post subject: Re: Name of current function Reply with quote

Christopher Benson-Manica wrote:

Quote:
C99 defines the manifest constant func, which expands to the name
of the current function. The C++ Builder 4 documentation pretty
clearly indicates that neither func nor the GNU version
FUNCTION are supported. Is this manifest constant or an
equivalent present in later versions of C++ Builder?

This is not a part of C++. There was a proposal to add it to the next
version, although I have heard no feedback on that so it may have died.
Maybe we should push it ourselves <g> [I think this is a great
feature, as we use it ourselves]

If you are using the Boost libraries, you can use the Boost macro
BOOST_FUNCTION_NAME that expands the compiler-defined function-name
macro where avaiable, or an empty string literal otherwise. That's
what we use, even though most our code is only compiled under BCB.

AlisdairM(TeamB)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Command Line Tools) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.