Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

GilliganCoder

C++ ellipsis in a macro for debugging?

This topic is 5462 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to set up my debugging scheme for my engine. Here's what Write() looks like: bool Write (char*, ...); I want to debug like this: WRITE_ERROR("Bad filename - %s", Filename); with WRITE_ERROR being some kind of macro or something that prints out __FILE__ and __LINE__ as well without having me write out that extra line of code for each WRITE_ERROR statement. I would like something like this, although I don't think it's possible: #define WRITE_ERROR(STR, ...) { Write(STR, __FILE__, __LINE__); } Any ideas how to do this? Thanks
[JESUS SAVES] [edited by - gilligancoder on August 8, 2003 9:33:14 PM] [edited by - gilligancoder on August 8, 2003 9:34:13 PM]

Share this post


Link to post
Share on other sites
Advertisement
Hey, that macro works great. I didn''t realize you could just put a comma into a macro like that. Learned something new though, and now I can send my error message with a one-liner with 4 lines of output. Thanks


[JESUS SAVES]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!